皆成今日我 发表于 2024-4-6 15:50:00

dddd

3139727348 发表于 2024-4-6 19:45:44

不知道

YoSeop 发表于 2024-4-6 20:44:31

0. 因为只认识0和1
1. 机器语言
2. 编译
3. 是否需要中间代码解释
4. 可以
5. 解释器将源代码转为中间代码
6. 查表
7. 亲们,趁敌人吃饭时,发动进攻

@211039027 发表于 2024-4-7 11:39:50

答案

huabcdf 发表于 2024-4-7 14:26:19

0:计算机只能识别二进制机器码,也就是0和1,
1:机器码
2:编译
3:
4:不能

qiQ321 发表于 2024-4-7 20:19:43

发生错误啊?

chenWei12 发表于 2024-4-7 21:21:32

1

sunny22 发表于 2024-4-7 23:10:53

因为计算机只认0和1。

EGV 发表于 2024-4-7 23:16:45


#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;
}

hefabing 发表于 2024-4-8 14:03:57

1

初学者12 发表于 2024-4-8 15:37:38

1

iqceance 发表于 2024-4-8 20:07:55

jj159517 发表于 2024-4-8 20:33:30

{:10_257:}

hengzi 发表于 2024-4-8 20:38:06

w

python_apple 发表于 2024-4-8 23:15:00

学习

GFX2022 发表于 2024-4-9 07:54:05

111

矿泉氺半瓶 发表于 2024-4-9 11:10:25

本帖最后由 矿泉氺半瓶 于 2024-4-9 11:14 编辑

夕波千鳥 发表于 2024-4-9 15:41:22

i

小丸子lalala 发表于 2024-4-9 18:49:15

{:5_109:}

小白8066 发表于 2024-4-9 21:26:58

{:5_105:}
页: 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 [2026] 2027 2028 2029 2030 2031 2032 2033 2034 2035
查看完整版本: S1E2:第一个程序 | 课后测试题及答案