答案
966080
lailelaile
目前你总共写了102行代码!
查看参考答案
{:7_112:}
看看答案{:10_281:}{:10_281:}{:10_281:}
0.因为计算机只认识0和1
1.机器语言
2.编译
3.一个需要翻译,一个不需要翻译
4.不能
5.不懂
6.查表
7
冲冲冲
k
{:5_109:}
qqq
666
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX256
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)
{
stuct _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)
{
stuct _finddata_t fa;
long handle;
char thePath;
strcpy(thePath, path);
if((handle = _findfirst(strcat(thePath, "/*"), &fa)) == -1L)
{
fprintf(stderr, "The path %s is worng!\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;
}
{:5_109:}
0.计算只能识别0和1
1.机器语言
2.编译
3.编译直接转化为机器码,解释型是从源代码转化为中间代码
4.不能
5.通过不同平台的解释器进行跨平台
6.查表
7.亲们趁敌人吃饭时发动进攻
(查了半天,还是不太理解编译型和解释型{:10_285:}{:10_285:})
终于打完了 结果报错{:5_99:}
测试题答案
我做到是做了,一个个敲击的指令,不知道怎么就出现了这种情况,现在这个文件更改我都不知道,敲击这个累计写入代码量的程序,是在视频结尾的程序里面测试吗?
我应该是抄错了,但是怎么修改我抄的指令呢,我重新在抄一遍?