逆风行者 发表于 2023-2-16 16:31:54

lllccchhh 发表于 2023-2-16 19:06:11

1

chen_xue_C 发表于 2023-2-16 19:50:18

11111

薯条可乐 发表于 2023-2-16 20:14:51

0.计算机只能识别0和1,所有的功能都是1和0排列组合实现的

1.机器语言,一系列0和1

2.编译

3.编译阶段 目标不同

4.不可以

5.将源代码转化称字节码,通过不同的解释器实现跨平台

6.点和横线的不同排练组合所代表的字母组成的信息

7.亲们趁敌人吃饭时发动进攻

吃个peach 发表于 2023-2-16 21:35:18

想看答案

18984362717 发表于 2023-2-16 21:47:25

1

atian12343 发表于 2023-2-16 23:10:14

1

快乐男孩zzk 发表于 2023-2-17 02:36:49

查看参考答案

要专注自己呀 发表于 2023-2-17 17:25:21

测试题:
0. 为什么我们说计算机其实是“二傻子”?
计算机的大脑是CPU ,而CPU唯一可以读懂的只有0和1的组合,即机器语言

1. CPU 唯一认识的语言是什么语言?
机器码(机器语言)

2. C 语言编写的源代码转换为汇编语言的过程叫什么?
编译

3. 编译型语言和解释型语言的本质区别是什么?
编译型语言是源代码最终被编译成机器码
解释型语言是源代码不直接编译为机器码,而是将源代码转化为中间代码

4. 在 Linux 系统上用 C 语言编译的可执行程序,是否能在 Windows 系统上执行?
不能。因为不同的操作系统可执行文件的格式不完全相同,Windows 上大部分可执行文件为 PE 格式,而 Linux 上大部分可执行文件为 ELF 格式,格式不同导致了不同的可执行文件无法跨平台直接使用

5. 解释型编程语言是如何实现跨平台的?
主要通过解释器实现跨平台

6. 莫斯密码的原理其实是什么?
根据莫斯编码表,原文编码为密文,密文解码为原文

7. 视频中小甲鱼“故弄玄虚”的那段密文还原后是什么内容(中文)?
亲们趁敌人吃饭时发动进攻

17775952321 发表于 2023-2-17 19:43:24

加油

gaohongcool 发表于 2023-2-17 19:55:05

1.计算机只认二进制的机器语言。
2.机器语言。
3.高级语言和低级语言,给计算机看和给人看?
4.不一定?两个系统可能会有区别?
5.?
6.这不重要啊
7.这不重要

小贺想要努力 发表于 2023-2-17 21:00:36

1

Yuu-s 发表于 2023-2-17 22:21:07

gogogo

无恙JJ 发表于 2023-2-18 10:06:42


skrskr 发表于 2023-2-18 10:26:35

{:5_90:}

786218631 发表于 2023-2-18 11:19:40

亲们趁敌人吃饭时发动进攻

Nominate 发表于 2023-2-18 11:45:05

0 二进制呗
1 机器语言
2 编译
3 跨平台
4 在linux系统上编译的可执行程序不能在windows上执行
5 自带翻译(靠的就是解释器,官方需要针对不同的平台开发不同的解释器,在不同的平台下,解释器会将相同的源代码转换成不同的机器码)
6 按组发送长短脉冲信号,对照摩斯密码表解析
7 亲们趁敌人吃饭时发动进攻

云不飘 发表于 2023-2-18 11:48:19

{:5_90:}

阳光下的小虫子 发表于 2023-2-18 15:32:30


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

陈维 发表于 2023-2-18 22:23:27

1
页: 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 [1848] 1849 1850 1851 1852 1853 1854 1855 1856 1857
查看完整版本: S1E2:第一个程序 | 课后测试题及答案