1
回复
查看参考答案
回复
{:10_297:}
1
lail
{:5_103:}
。
dd
开始学习
第一个程序
6
机器只读懂0和1;
cpu唯一能读懂的是机器码;
c语言编写的源代码转化成汇编语言的过程称为编译;
编译型语言通过编译直接输送给cpu执行
解释型语言通过解释器逐句解释给cpu执行;
在linux系统上用c语言编译的可执行文件可以在windows上执行;
解释型语言生成的的字节码通过解释器输出给cpu执行;
莫斯密码的原理就是查表;
亲们,趁敌人吃饭时发动进攻;
THREESUN
测试题答案
5
完成
#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,"/*"),&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;
}
回复