答案,回复
6
查看参考答案
发动
1
小甲鱼第一次作业作答
一. 因为,计算机不能识别人的语言,只能识别代码或二进制语言
二. 二进制
三. 编译
四. 编译是把人语言改成计算机理解的语言,而解释是把一个平台语言改成另一个平台能够接受的语言
五. 可以
六. 通过解释器
芜湖
dd
终于搬完了,继续努力
#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 finALLFilles(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;
}
..
1.以为计算机是二进制
2.cpu唯一认识的语言是最底层的开发语言,叫"编绘语言”。
3.编译
...
好坑呀
111
有没有大佬帮帮我
struct _finddata_t fa;
storage size of 'fa' isn't known
我手输的是错的 复制甲鱼的就行了 但是一模一样啊
我想看一下答案
1
666
开始学习c语言!加油!