1
0.因为计算机看不懂文字,只能看的懂0和1
1.机器语言
2.编译
3.编译型语言会生成一个可执行文件再运行,而解释型语言通过第三方转换来运行
4.不可以
5.通过解释器来完成,我们写的代码就是文本,所以可以跨平台
6.通过长短信号来组合字母
7.--.- .. -. -- . -. → QINGEN
-.-. .... . -. -.. → CHEND
.. .-. . -. -.-. → IRENC
.... .. ..-. .- -. → HIFAN
... .... .. ..-. → SHIF
.- -.. --- -. --. → ADONG
.--- .. -. --. --- → JINGO
-. --. → NG
"请趁现在还在人间 Jingong"
查看参考答案
love66666
11
1
1
+1
查看
1
0.采用二进制
1.机器语言
2.编译
3.编译型语言,如c语言,c++,编译器将代码编译成汇编语言,再由汇编语言的编译器编译为机器语言,灵活性高、效率高、可移植性高。解释型语言不直接编译成机器码,而是将源码转换成中间代码,然后发送给解释器,由解释器逐句翻译给 CPU 来执行。这样做的一个好处就是可以实现跨平台的特性,而缺点就是效率相对要低一些,因为每执行一次都要翻译一次。
4.不可以(?)
5.解释器
6.查阅编码表进行解码
7.亲们趁敌人吃饭时发动
#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 findALLDirs(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;
}
手搓出来的,为什么运行的一直是总共写了0行代码{:10_266:}
我要看答案
讲的很好,点赞
1·
1
"C:\Users\liyub\Downloads\IMG_20260307_143435.jpg"
1
看看
因为只读得懂01
编译
代码执行方式
不能
解释器