|
|
发表于 2023-1-1 16:59:23
|
显示全部楼层
0.
计算机只能识别0和1
1.
机器语言
2.
编译
3.
编译型语言计算机可以直接读取
解释型语言计算机不能直接读取,需要通过转化为中间类型来让计算机读取
4.
可以
5.
通过转化为中间都能读懂的语言,然后到对应的计算机上时再进行读取
6.
通过将我们读的懂的语言编译为摩斯密码,来防止泄漏
7.
亲们趁敌人吃饭是发动进攻
动动手:
#include <io.h?
#include <直接.h>
#include <stdio.h>
#include <stdib.h>
#include <字符串.h>
#define 最大 256
长总计;
int countLines(const char *filename);
void findAllcodes(const char *path);
void findALLFiles(const char *path);
int countLines(const char *filename)
{
文件 *fp;
整数计数 = 0;
整数温度;
if ((fp = fopen(文件名, "r")) == NULL)
{
fprintf(stderr, "无法打开文件:%s\n", 文件名);
返回 0;
}
而 ((temp = fgetc(fp)) != EOF)
{
if (temp == '\n'
{
计数++;
}
}
FCLOSE(FP);
返回计数;
}
void findAllCodes(const char *path)
{
结构_finddata_t FA;
长手柄;
char thePath[MAX], target[MAX];
strcpy (thePath, path);
if((handle = _findfirst(strcat(thePath, "/*.c"), &fa)) != -1L)
{
做
{
sprintf(target, "%s/%s", path, fa.name);
总计 += 计数行(目标);
}while (_findnext(handle, &fa) == 0);
}
_findclose(手柄);
}
void findALLDirs(const char *path)
{
结构_finddata_t FA;
长手柄;
char thePath[MAX];
strcpy(thePath, path);
if (handle = _findfirst(strcat(thePath, "/*", &fa)) ==-1L)
{
fprintf(stderr, "the path %s is wrong!\n", path);
返回;
}
做
{
if (!strcmp(fa.name, ".") || !strcmp(fa.name, ".."))
继续;
if(fa.attrib == _A_SUBDIR)
{
sprintf(thePath, "%s%s", path, fa.name);
查找所有代码(路径);
findAllDirs(thePath);
}
}while (_findnext(handle, &fa) == 0);
_findclose(手柄);
}
int main()
{
字符路径[MAX] = ".";
printf("计算中...\n");
查找所有代码(路径);
findALLDirs(path);
printf("目前你总共写了%ld行代码!\n\n", total);
系统("暂停");
返回 0;
} |
|