查看隐藏内容
测试题:
0: 计算机只认识0和1
1、机器语言
2、编译
3、编译型语言源程序直接编译成机器语言,解释型语言先在虚拟机中编译成字节码文件,在解释成CPU所能执行的指令
4、不能,因为C是编译型语言
5、先翻译成字节码,再解释为CPU所能执行的指令,从而实现了夸平台性
6、莫斯密码的原理是由点横不同的排列来组成代表字母A-Z,最后拼合在一起形成一个完整的英文,实现了加密解密
7、qin men chen di ren chi fan shi fa dong jin gong 请门城的人吃饭时发动进攻
{:7_131:}
1
加油每一天
0.因为二进制
1.机器码
2. 编译
3.C语言可直接执行语言,解释型语言不直接执行语言,每次执行需要将源代码转化为中间代码
4.可以
5.
6.查表
7.
1
看答案
#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("目前你总共写了 %ld 行代码!\n\n", total);
system("pause");
return 0;
}
file:///C:/Users/16345/Desktop/%E6%89%B9%E6%B3%A8%202020-08-14%20095105.png
你好!这个搞了几天了!还是不知道哪里问题
你好!这个能帮我看看么
答案
1
答案
。
看看
答案
做完了
本帖最后由 ysc1 于 2020-8-14 14:15 编辑
完成
爱你