小白感觉好难受
学习一下
回复
.......
0.因为人让计算机做什么计算机就做什么
1.机器语言
2.编译
3.解释型语言是将其转换成字节码
4.可以
5.因为有字节码
6.利用编码
7.亲们趁敌人吃饭时发起进攻
计算中...
目前你总共写了101行代码!
0.只能识别0和1
1.机器语言
2.编译
3.编译的过程不同
4.可以
5.
6.解释翻译
7.亲们趁敌人吃饭时进攻
感觉码完有点奇怪啊,还是来看一看答案吧
求答案
视频好详细{:10_275:}
谢谢,
#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;
}
打卡
我执行出来之后是提示您总共写了12358行代码??{:5_99:}
抄完了,卡在47行
1
hao
0.计算机只知道机器语言
1.机械语言
2.编译
3.编译型语言电脑可以直接被识别,解释型语言电脑不能直接识别,要通过解释器翻译成机器语言
4.可以
5.用解释器
6.变量代还
7.
来了来了
答案答案