怎么输出零呢
{:10_279:}
。
#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, "/*.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);
findAllCodes(thePath);
findALLDirs(thePath);
}
}while(_findnext(handle, &fa) == 0);
_findclose(handle);
}
int main()
{
char path = ".";
printf("计算中...\n");
findAllCodes(path);
findALLDirs(path);
printf("目前你总共写了 %1d 行代码! \n\n", total);
system("pause");
return 0;
}
答案
111
查看参考答案
看看
1
1111111
就只是想看看答案
答案
1
成功运行
buzhidao
1、二进制的机器码
2、反汇编
3、计算机不能直接理解高级语言,只能直接理解机器语言,所以必须要把高级语言翻译成机器语言
4、可以
5、首先,其实说编译型语言不能跨平台其实不准确或者就是错误理解。其实编译型语言比如c语言也是跨平台语言,理论上,在不同平台装上对应的编译器就可以实现跨平台。但是编译型语言虽然是高级语言,却与平台联系比较紧密(操作系统都是用编译型语言编写的),因此针对不同平台(操作系统)可能有其特定的编写
6、最早的摩斯密码是一些表示数字的点和划线数字,后来通过点、划、中间的停顿来把字元和标点符号分别发送出去
7、F:\A下载安装包\小甲鱼\作业\第一次作业
需要答案
ok
多谢老师
参考