看答案
daan
{:5_90:}
不知道
给我看看
1
他只能识别0和1
#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;
}
123
0.因为计算机的CPU只懂得二进制的0和1;
1.机器语言;2.编译;
3.编译型语言可将源代码直接编译成机器码,从而被CPU直接识别;解释型语言是将源代码转化成中间代码,再通过解释器翻译,从而被CPU识别。
4.能。
5.通过解释器翻译中间代码而实现跨平台;
6.将原文进行编码(查表);7.QINMENCHENDIRENCHIFANSHIFADONGJINGONG。
0:只认识0和1
1:机器语言
2:编译
3:编译过程不同
4:可以
5:字节码到解释器的过程可以跨平台操作
6:编码和翻译
7:。。。。。
本帖最后由 1436793975 于 2021-10-13 21:40 编辑
952行
{:5_102:}
看看对比一下结果
DAAN
1
访问
.
学习学习{:5_109:}