丁子康 发表于 2020-11-11 17:08:01

感谢楼主无私奉献!

仙女小任 发表于 2020-11-11 17:36:54

0. 计算机只能识别0.1两个两个数字,如果输入其他的数字输入计算机,系统不能识别。
1.机器语言,即0.1两个数字
2.转码
3.编译型语言经过转换可以被电脑进行识别,解释性语言简单易懂需要经过复杂的译码才能被计算机识别。
4.可以
5.对于编译型语言来讲不能跨平台的解释实际上是错误的,因为编译型语言与平台联系比较紧密,编译型语言是针对不同的平台进行特定的编写,放在其他平台上,不容易编译。若能避免特殊的使用,编译语言就能进行跨平台的使用了。
6.通过不同的排列顺序来表达不同的英文字母、数字和标号符号

南路會所 发表于 2020-11-11 17:39:47

.

文消消 发表于 2020-11-11 18:27:48

1

humen123 发表于 2020-11-11 18:36:11


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

墨吏 发表于 2020-11-11 19:45:49

{:10_243:}

于野 发表于 2020-11-11 20:04:18

如图

depjka 发表于 2020-11-11 20:13:28

查看参考答案

陈小咪@ 发表于 2020-11-11 20:35:53

1

我是小李 发表于 2020-11-11 21:41:52

哇咔咔咔咔

2241153660 发表于 2020-11-11 22:45:07

小甲鱼爱你哦

2987084853 发表于 2020-11-11 23:26:31

好奇测试题答案

热爱小宝 发表于 2020-11-12 09:00:56

不懂自然语言
1.机器语言
2.汇编
3.翻译是一边翻译一边执行    编译是先翻译在执行
4可以
5.因为是一边翻译一边执行

小曹网络 发表于 2020-11-12 09:12:14

6

学c的小fw 发表于 2020-11-12 09:48:30

1

J1awexr 发表于 2020-11-12 10:14:39

0因为是二进制
1机器语言
2编译
3是否直接编译成汇编语言
4否
5源代码-中间代码-解释器-cpu
6查表
7亲们 趁敌人吃饭时发动进攻

祁小儒 发表于 2020-11-12 12:11:23

I love fish

wangqi_27 发表于 2020-11-12 16:14:59

0、二进制
1、机器
2、编译
3、效率和发生过程
4、能
5、解释器
6、编译
7、忘了

lanshj 发表于 2020-11-12 17:58:22

0.只认识0和1
1.解释型语言
2.编译
3.
4.能
5.
6.二进制数
7.qinmenchendirenchifanshifadsngjingong

hikun 发表于 2020-11-12 18:03:21

编译器语言
编译
能否被计算机识别


编译
页: 936 937 938 939 940 941 942 943 944 945 [946] 947 948 949 950 951 952 953 954 955
查看完整版本: S1E2:第一个程序 | 课后测试题及答案