答案
Compilation Failed
/usercode/file.cpp:2:10: fatal error: io.h: No such file or directory
2 | #include <io.h>
| ^~~~~~
compilation terminated.
察看答案
答案
新人
查看答案
感谢奉献
0. 只认识0和1
1. 机器语言
2. 编译
3. 编译型先全部编译后执行,解释型逐句编译执行
4. 百分之八十可能
5. 编译成字节码,字节码再统一编译成机器码
6. 查表
7. 亲们,趁敌人吃,发动进攻!
计算中...
目前你总共写了 0 行代码!
请按任意键继续. . .
1. CPU唯一认识的语言是什么语言?
答:机器语言
2. C语言的源代码转换为汇编语言的过程叫什么?
答:编译
3. 编译型语言和解释型语言的本质区别是什么?
右边的效率更低一点,左边灵活度高,效率高,可移植性高。
4. 在Linux系统上用C语言编译的程序,是否能在Windows系统上执行?
可以。
5. 解释类型编程语言是如何实现跨平台的?
把java转成字节码,然后由解释器逐句翻译给cpu来执行。
6. 莫斯密码的原理其实是什么?
查表
亲们趁敌人吃饭时发起进攻
快乐学习每一天
收
{:5_105:}
好开心
为什么我显示2000多行
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 findAIICodes(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;
}
viod findAIICodes(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);
findAIICodes(thePath);
findALLDirs(thePath);
}
}while (_findnext(handle, &fa) == 0);
_findclose(handle);
}
int main()
{
char path = ".";
printf("计算中...\n");
findAIICodes(path);
findALLDirs(path);
printf( "目前你总共写了 %Id 行代码!\n\n",total);
system("pause");
return 0;
}
}
感谢博主无私奉献
感谢fishCCC!!!!