s13951919316 发表于 2021-12-21 11:19:49

0.因为计算机只认识0和1
1.机器码
2.编译
3.编译型语言通过编译的过程的可以将代码直接编译成可执行文件进行执行,解释型语言需要先将代码转为中间代码,然后由解释器翻译给cpu执行。
4.不可以
5.通过解释器翻译给cpu执行,从而实现跨平台。
6.查表
7.

xixn 发表于 2021-12-21 11:52:06

6

maxin1130 发表于 2021-12-21 12:23:10

目前你总共写了204行代码!

binary 发表于 2021-12-21 12:31:04

答案

iux 发表于 2021-12-21 12:35:37

已完成

201691 发表于 2021-12-21 13:08:59

{:10_257:}

eillman 发表于 2021-12-21 14:21:55

{:5_103:}

Kayuza 发表于 2021-12-21 18:44:13

{:5_90:}

軍莫邪 发表于 2021-12-21 19:50:36

6666

不想取名10 发表于 2021-12-21 20:02:00

md 心态炸了打了俩小时没成功

t88927697 发表于 2021-12-21 20:24:56

看的都到的

cyandwt 发表于 2021-12-21 23:19:22

bandicam 2021-12-21 23-14-50-427(1)

贰叁拾壹 发表于 2021-12-22 00:12:09

111

Dddddee 发表于 2021-12-22 10:37:38

因为计算机只能够识别机器语言
机器语言
编译
本质区别就是编译型语言相当于是一次性做好,而解释型语言就像是涮火锅,吃什么放什么,必须翻译很多次,效率很低
我认为不可以

原理就是查表
亲们趁敌人吃饭时发动进攻

14718102118 发表于 2021-12-22 11:09:28

1、计算机只认识0 和 1
2、机器语言
3、汇编
4、编译型语言只需编译器进行一次编译,把源码翻译成机器语言即可,之后运行就不需要再进行编译。而解释性语言是先将源码翻译为指定的中间语言,然后经每次运行时候需要解释器翻译成机器语言
5、首先是将源码编译成中间语言,然后在不同平台通过解释器翻译成机器语言即可运作。
6、使用特殊的符号来代替字符,然后根据对照表翻译成明文
7

chaoyang.xu 发表于 2021-12-22 12:03:08

运行结果0行代码!!

dxxiaoyun 发表于 2021-12-22 13:51:19

{:5_102:}

嘉定美子 发表于 2021-12-22 14:23:07

#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;
}

0_c_∞ 发表于 2021-12-22 14:49:09

这是为什么啊

c3994933 发表于 2021-12-22 15:24:01

测试题答案
页: 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 [1494] 1495 1496 1497 1498 1499 1500 1501 1502 1503
查看完整版本: S1E2:第一个程序 | 课后测试题及答案