终于做完作业了
开始有不少错误
C:\Users\aa\Desktop\QQ截图20160108110947.jpg
后来都改正了
C:\Users\aa\Desktop\QQ截图20160108111532.jpg
作业已完成,第一次回复的时候图片没有放上去,再回复一个
奋斗中,,,,,,
我要不……有、不
Have a look{:10_255:}
0.因为计算机只识别机器语言
1.机器语言
2.编译
3.编译型语言直接运行,解释型语言要解释
4.能,因为linux和windows都是c写的
5.靠解释器跨平台
6.查表
7.qin men chen di ren chi fan sho fa dong jin gong
亲们趁敌人吃饭时候发动进攻
哎感觉还是菜鸟啊
1
小甲鱼辛苦了。
DDDD
QFGR
CHRD
IRRC
HJIP
SHIF
PJNG
JFGO
NG
啥情况这是.
哈哈,刚开始打到了Mac的代码,随后修改会Windows的代码.感觉修改起来不容易呀
编译不出来,不知道为什么
0.因为计算机只会0和1两个字
1.汇编语言。。吧
2.
先看看
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX256
long total;
int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);
int counstLines(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("您目前总共写了%ld行代码! \n\n", total);
system("pause");
return 0;
}
{:5_92:}
初学者自学中。。。。。。。。
看看答案,已经做完了~