{:5_90:}
查看参考答案
感觉莫斯密码不对啊
# ./homework
计算中...
目前你总共写了 112 行代码!
呜呜
冲冲冲
答案
好多阿
加油!
初来乍到
。
1
计算机语言
查看
14
0.计算机只能执行正确的命令
1.CPU唯一认识的是机器语言,也就是由0和1组成的语言
2.C语言编写的源代码转换为汇编语言的过程称为编译
3.编译型语言是由编译器将高级语言转换汇编语言,然后再由汇编语言编译器转换为机器语言,从而让CPU能够读懂并执行;解释型语言是由将源代码转化为中间码,然后将中间码发送给编译器,由编译器逐句翻译给CPU执行,也因此编译型语言效率更高。
4.可以。
5.将解释型编程语言转化为中间码,然后将中间码发送给编译器,由编译器逐步翻译给CPU执行。
6.查表,每个字符都和一个码相对应。
7.Q I N M E N
C H E N D
I R E N C
H I F A N
S H I F
A D O N G
J I N G O N G
111
111
答案
#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 findALLFilse(const char *path);
int countLines(const char *filename)
{
FILE *fo;
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(temo == '\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(syrcat(thePath,"/*.c"),&fa))!= -1L)
{
do
{
sprintf(target,"%s/%s",path,fa.name);
titak += 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;
}
不了解怎么错了,来自电脑小白