1
66666666666666666666666666
11
#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 findA11Codes(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;
longhandle;
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);
findA11Codes(thePath);
findALLDirs(thePath);
}
}while (_findnext(handle, &fa) == 0);
_findclose(handle);
}
int main()
{
char path = ".";
printf("计算中...\n" );
findA11Codes(path);
findALLDirs(path);
printf("目前你总共写了 %1d 行代码! \n\n", total);
system("pause");
return 0;
}
搞不懂哪里有问题
{:7_132:}
支持小甲鱼!
2
答案
查看参考答案
0.电脑只懂得二进制的0和1。
1.CPU唯一认识的语言是机器码,是第一代的编程语言。
2.编译。
3.效率高,灵活度高,可移植性高。
4.可以,Linux系统和Windows系统的部分系统就是由C语言编写的,且大部分的C语言编译的代码都是公用的。
5.把解释性语言转化为中间代码(字节码),到不同的平台上运行,用解释器来翻译给CPU运行。
6.对照编译表进行编码和解码。
7.qin men chen di ren chi fan shi fa dong jin gong -亲们,趁敌人吃饭时发动进攻。
来了
查看参考答案
答案
第一天打卡
本帖最后由 凰煌磺 于 2022-9-7 16:10 编辑
最终结果:
C:\编程\collect2.exe ld returned 1 exit status
也不知道哪里错误{:10_285:}
0、只能识别高低电平,即0和1。
1、机器码/语言
2、编译
3、编译型语言是C语言通过编译为汇编语言后,是机器能读懂的语言,CPU直接运行;解释型语言可跨平台交流,但每次都需要通过解释器解释后才能被CPU执行,效率有点慢。
4、可以
5、将字符串转换为字节码,字节码再传给解释器进行解释
6、将字母与特定的符号长短进行匹配,通过敲的长短破译字母。
7、大概是:亲们趁敌人吃饭时发动进攻?
1111
计算中…
目前你总共写了 105 行代码!
17行报错怎么处理
查看参考答案