mys666 发表于 2023-1-29 13:25:34

666

Cecilia·Suline 发表于 2023-1-29 19:40:10

0、只能懂由0和1组成的机器语言
1、机器语言
2、编译
3、编译型语言是直接转化为机器语言交给cpu执行,解释性语言转化为字节码通过解释器给CPU执行
4、不行
5、/
6、编码和解码
7、亲们趁敌人吃饭时发动进攻 qinmenchendirenchifanshifadongjingong

Gyyf 发表于 2023-1-29 19:57:00

只会二进制
机器语言
编译

Johhan丶Ryan 发表于 2023-1-29 21:40:35

666

showtime123 发表于 2023-1-29 22:56:46

1111

AKA汉谟拉比 发表于 2023-1-30 10:19:11

1.30

SOSOKOKO 发表于 2023-1-30 11:51:29

好!

lookl 发表于 2023-1-30 13:16:06

查看参考答案

学C的陆地松鼠 发表于 2023-1-30 13:54:49

陆地松鼠

Gangtiexia 发表于 2023-1-30 14:21:45

108

Lane2 发表于 2023-1-30 14:23:54

成功啦

不会说话就闭嘴 发表于 2023-1-30 14:25:55

WM

1367477576 发表于 2023-1-30 16:30:02

1/30

FreyaD 发表于 2023-1-30 17:31:09

test

lizhao2020 发表于 2023-1-30 18:55:24

查看

luolei123 发表于 2023-1-30 19:42:50

1

zyb981123 发表于 2023-1-30 20:37:27

看答案

978564028 发表于 2023-1-30 21:14:22

1

兵荒马乱多肉 发表于 2023-1-30 21:39:41


#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX      256

long total;

int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);

int countLines(const char *filename)
{
      FILE *fp;
      int count = 0;
      int temp;
      
      if ((fp = fopen(filename, "r")) == NULL)
      {
                fprintf(stderr, "Can not open the file:%s\n", filename);
                return 0;
      }
      
      while ((temp = fgetc(fp)) != EOF)
      {
                if (temp == '\n')
                {
                        count++;
                }
      }
      
      fclose(fp);
      
      return count;
}

void findAllCodes(const char *path)
{
      struct _finddata_t fa;
      long handle;
      char thePath, target;
      
      strcpy(thePath, path);
      if((handle = _findfirst(strcat(thePath, "/*.c"), &fa)) != -1L)
      {
                do
                {
                        sprintf(target, "%s/%s", path, fa.name);
                        total += countLines(target);
                }while (_findnext(handle, &fa) == 0);
      }
   
      _findclose(handle);
}

void findALLDirs(const char *path)
{
      struct _finddata_t fa;
      long handle;
      char thePath;
      
      strcpy(thePath, path);
      if((handle = _findfirst(strcat(thePath, "/*"), &fa)) == -1L)
      {
                fprintf(stderr, "The path %s is wrong!\n",path);
                return;
      }
   
      do
      {      
                if (!strcmp(fa.name, ".") || !strcmp(fa.name, ".."))
                        continue;
                  
                if( fa.attrib == _A_SUBDIR)
                {      
                        sprintf(thePath, "%s/%s", path, fa.name);
                        findAllCodes(thePath);
                        findALLDirs(thePath);
                }
      }while (_findnext(handle, &fa) == 0);
   
      _findclose(handle);   
}

int main()
{
      char path = ".";
      
      printf("计算中...\n");
      
      findAllCodes(path);
      findALLDirs(path);
      
      printf("目前你总共写了 %ld 行代码!\n\n", total);
      system("pause");
      
      return 0;
}

Lighting. 发表于 2023-1-31 00:33:08

{:5_109:} 敲完了 但是你的10k图片让我很难
页: 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 [1838] 1839 1840 1841 1842 1843 1844 1845 1846 1847
查看完整版本: S1E2:第一个程序 | 课后测试题及答案