暗号
本帖最后由 代码白白 于 2021-8-15 14:04 编辑
。
查看参考答案
查看答案。这是我运行的结果176行代码
回复回复回复回复
本帖最后由 CieraWilly 于 2021-8-15 16:25 编辑
测试题:
只读得懂0和1
机器语言
编译
编译型语言先被编译成汇编语言,最终被编译成机器语言,而解释型语言先被转换为中间代码,再由解释器一句一句解释给CUP
能 改: 不能,准备工作不同,文件格式不同
解释器
二进制
略
#include <in.o>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 256
lng total;
int countlines(const char *filename);
void findAllCodes(const char *path);
vid findALLfiles(const char *path);
int countlines(const char *filename)
{
FILE *fp;
int cunt = 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 findAllCdes(const char *path)
{
struct_finddata_t fa;
long handle;
char thePath;
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);
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;
}
查看参考答案
1
daan
131
发送不了图片啊
0 只认识机器语言
1 机器语言
2 编译
3 效率
4 不能
5 解释器可以安装在不同平台,来解释其他平台的代码
{:9_228:}
看看答案
回复?
加油
来了
{:5_90:}
已做!