studymakesmehap 发表于 2021-8-1 14:54:47

6666

我是新手11 发表于 2021-8-1 14:55:54

0.他只知道0和1进制
1.机械语言
2.编译
3.一个简单,一个复杂,效率低
4.不行
5.查表

cwlong 发表于 2021-8-1 15:06:25

1

贩卖黄昏· 发表于 2021-8-1 15:25:29

rbl11 发表于 2021-8-1 15:29:23

0.计算机 CPU 只认识 0 和 1
1.机器语言
2.编译
3.对于 CPU 而言,编译型语言是将源代码先通过编译器编译为 CPU 认识的机器码(可执行文件),此后 CPU 随时都可以直接执行编译后的机器码;而解释型语言则不直接编译成机器码,而是将源码转换成中间代码,然后发送给解释器,由解释器逐句翻译给 CPU 来执行
4.不能去,格式不同
5.解释型编程语言为每个操作系统专门定制一个解释器作为中转,因此解释器只需提供一个统一的入口即可
6.转化

ETOHF 发表于 2021-8-1 15:58:09

1

cqy1357273018 发表于 2021-8-1 16:15:04

答案是0吗?

阿良/ 发表于 2021-8-1 16:25:40


#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("目前你总共写了 %1d 行代码! \n\n", total);
        system("pause");
       
        return 0 ;
}

       
       

川流801 发表于 2021-8-1 17:07:40

看看题吧

Darren1015 发表于 2021-8-1 17:12:32

0.计算机只识别0/1;
1.机器语言(0/1);
2.编译;
3.编译型语言直接可以编译即可让计算机识别;而解释型语言需要用解释器;
4.编译过后是可以执行的;
5.通过解释器去实现;
6.相对应的翻译

米沙沙 发表于 2021-8-1 17:18:20

查看参考答案

罔两. 发表于 2021-8-1 17:52:20

0.只认识二进制
1.机器码
2.编译
3.编译型CPU直接执行,解释型间接执行
4.能
5.将源代码转化为中间代码,再通过解释器解释给CPU执行
6.编码和解码
7.亲们趁敌人吃饭时发动进攻

BevisPark 发表于 2021-8-1 18:35:31

1

chchg 发表于 2021-8-1 19:37:59

、、、、

苏新 发表于 2021-8-1 20:38:20

{:10_277:}

持之以恒mm 发表于 2021-8-1 20:49:45

小甲鱼加油

sss666 发表于 2021-8-1 20:51:47

查看答案

7johnson7 发表于 2021-8-1 21:08:05

即将写下第一行代码~

7johnson7 发表于 2021-8-1 21:15:06

交作业

xxban 发表于 2021-8-1 21:16:50

{:5_109:}
页: 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 [1288] 1289 1290 1291 1292 1293 1294 1295 1296 1297
查看完整版本: S1E2:第一个程序 | 课后测试题及答案