打卡
参考答案
滴滴打卡
111
完成作业
已完成
1.机器语言
2.编译
3.编译型语言效率高、灵活度高、可移值性高
4.
5.将源代码转化为中间代码,发送给解释器,
解释器逐句翻译给CPU执行
从0开始
鱼C有你更精彩^_^
#include <>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <字符串>
#define 最大 256
长总计;
int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);
int countLines(const char *filename)
{
文件 *fp;
整型计数 = 0;
int temp;
if ((fp = fopen(filename, “r”)) == NULL)
{
fprintf(stderr, “Can not open the file:%s\n”, filename);
返回 0;
}
while ((temp = fgetc(fp)) != EOF)
{
if (temp == '\n')
{
计数++;
}
}
fclose(fp);
返回计数;
}
void findAllCodes(const char *path)
{
结构_finddata_t法;
长手柄;
char thePath, target;
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法;
长手柄;
char thePath;
strcpy(thePath, path);
if((handle = _findfirst(strcat(thePath, “/*”), &fa)) == -1L)
{
fprintf(stderr, “path %s is error!\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()
{
字符路径 = “.”;
printf(“计算中...\n”);
findAllCodes(path);
findALLDirs(path);
printf(“目前你总共写了 %ld 行代码!\n\n”, total);
系统(“暂停”);
返回 0;
}
看答案
查看参考答案
0. 二进制
1.机器语言
2.编译
3.需不需要解释
4.不能
5.解释器可以跨平台使用
6.
我要看答案
看答案
{:5_105:}
无
0、因为计算机的大脑是CPU,CPU负责计算机大部分日常的计算功能,而CPU原理上只认识0和1。
1、CPU唯一认识的语言是最底层的开发语言,叫机器语言,也叫汇编语言。
2、编译。
3、对于CPU而言,编译型语言是将源代码先通过编译器编译为CPU认识的机器码,此后CPU随时都可以直接执行编译后的机器码;而解释型语言则不直接编译成机器码,而是将源码转换成中间代码,然后发送给解释器,再由解释器逐句翻译给CPU来执行。
4、不能,不同的操作系统可执行文件的格式不完全相同。
5、解释型编程语言为每一个操作系统专门定制一个解释器作为中转,因此解释器只需提供一个统一的入寇即可。
6、用特殊的符号代表具体的字母。
鱼C有你更精彩^_^
{:5_103:}