此帖仅作者可见
0、因为计算机的大脑是CPU,CPU只能识别“0”和“1”也就是机器语言
1、机械语言
2、编译
3、编译型语言是CPU直接执行编译后的机器语言,解释型语言是指将源代码转换成中间代码,发送给解释器,解释器翻译给CPU执行
4、不能
5、源代码转换成中间代码,发送给解释器,解释器翻译给CPU执行
6、机器语言
7、QINMENCHENDIRENCHIFANSHIFADONGJINGONG
S1E2:第一个程序
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 256
int countLines(const char *filename);
void findALLCodes(const char *path);
void findALLDirs(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 (_findnet(handle, &fa) == 0);
}
_findclose(handle);//<direct.h>
}
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;
}
测试题答案
daan
看看
本帖最后由 瑟瑟发抖的W 于 2021-2-16 16:22 编辑
我的是
计算中...
目前你总共写了217行代码!
查看参考答案
测试题:
0.因为计算机只能读懂0和1
1.机器码(机器语言)
2.编译
3.编译型语言可以直接运行,而解释型语言不能直接运行
4.有些可以直接运行,有些需要进行修改才能运行
5.通过生成字节码。再通过解码器进行运行
6.通过发送解码表中对应的符号进行传递信息
7.亲们趁敌人吃饭时发动进攻
动动手:
计算中...
目前你总共写了 101 行代码!
(截图有点问题所以只能打字了)
谢谢甲鱼
0.
1.机器语言
2.编译
3.解释型语言不直接编译成机器码而将源代码转化成中间代码
4.能
5.
6.查找指令表
7.
有点难
好了
{:5_102:}
答案
1
6666
233