DNA_brain 发表于 2022-10-30 20:42:34

计算机工作基于二进制,只能识别和接受1和0组成的指令
机器语言
编译
能否直接被CPU执行
由解释器翻译给CPU执行
查表

御坂19090 发表于 2022-10-30 21:15:16

1

小飞雨 发表于 2022-10-30 22:21:40

0:计算机主要是以cpu为主,cpu是计算机的大脑,用来识别’0‘和’1‘
1:cpu唯一识别的语言是机器语言也就机器码
2:编译型语言主要是将源代码通过编译器转换成机器码,cpu随时可以识别机器码;而解释型语言不直接编译成机器码而是将源代码转换成中间代码由解释器转给cpu执行
4:不能应为同一个可执行文件在不同操作系统的准备工作是不同的造成可执行文件的格式不同
5:设置一个统一的系统
6:摩斯密码使用特殊的符号来指代具体的字母
7:

fearless-cat 发表于 2022-10-30 23:05:13

0:因为计算机只认识0和1两个数;计算机反应快,但是没有自主的思维能力。
1:机械语言
2:编译过程
3:编译语言需要通过编译和链接形成可执行文件,而解释语言是通过解释编码器解码所得到。解释语言不可以链接成可执行文件。
4.不能
5。解释语言是依赖于不同平台的相应的解释编码器。
6.对照密码本进行翻译
7.i don‘t know

wanfeng233 发表于 2022-10-30 23:39:05

感谢分享

程少先森 发表于 2022-10-31 01:00:21

https://imgse.com/i/xoe90A

Major. 发表于 2022-10-31 08:47:12

66666666666666666666666

西泽尔.博尔吉亚 发表于 2022-10-31 09:50:38

哈哈

HelloTeen 发表于 2022-10-31 10:19:01

1

口罩233 发表于 2022-10-31 16:01:55

kan

alex12444 发表于 2022-10-31 16:15:48

hhhhhhhhhhh

阿潘 发表于 2022-10-31 16:54:02

a

1951063853 发表于 2022-10-31 17:04:11

1

超级璇璇1120 发表于 2022-10-31 17:43:22

{:5_109:}

yaoz7 发表于 2022-10-31 17:44:26


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

fz学c 发表于 2022-10-31 18:59:05

敲代码师傅雨熙 发表于 2022-10-31 19:46:02

2022.10.31打卡

xyl2022.10.2 发表于 2022-10-31 21:09:32

s1e2
只能执行不能思考
机器语言
编译
都为了让机器为人类所用
编译型在写好代码后直接转换为机器语言,解释型在使用时转换

转换成机器语言
硬盘存储原理


learner 的密码:
root@learner-virtual-machine:/home/learner/学c# ./callline
计算中...
目前你总共写了 112 行代码!

OGS 发表于 2022-10-31 21:28:52

RE: S1E2:第一个程序 | 课后测试题及答案

说句晚安听吧 发表于 2022-10-31 22:55:57

6
页: 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 [1790] 1791 1792 1793 1794 1795 1796 1797 1798 1799
查看完整版本: S1E2:第一个程序 | 课后测试题及答案