天涯101 发表于 2023-7-6 17:42:49

机器语言

只是寒暄 发表于 2023-7-6 20:47:12

1

Aqqzuishuai 发表于 2023-7-6 23:31:47

1

CliPg 发表于 2023-7-7 09:07:00

查看答案

Cx330S 发表于 2023-7-7 10:19:27

zahnig 发表于 2023-7-7 10:58:40

感谢大大

1784861653 发表于 2023-7-7 11:09:51

答案

男德班刘怂怂 发表于 2023-7-7 11:20:33

做完啦

xunming 发表于 2023-7-7 11:43:02

请求

YZT66 发表于 2023-7-7 15:48:31

0.为什么我们说计算机其实是“二傻子”?
因为计算机只会识别机器语言,没办法理解高级语言。且计算机只会依照指令顺序依次执行直到不能运行为止。
1.CPU 唯一认识的语言是什么语言?
机器语言
2. C 语言编写的源代码转换为汇编语言的过程叫什么?
译码
3.编译型语言和解释型语言的本质区别是什么?
编译型语言是先将高级语言直接译码为机器语言,计算机可以直接识别并运行。
解释性语言是将高级语言通过译码器为机器语言,计算机运行前需再译码一次。
4.在 Linux 系统上用 C 语言编译的可执行程序,是否能在 Windows 系统上执行?
不能,因为C语言是编译型语言,在不同的平台上有不同的译码方式,跨系统执行会导致错误。
5.解释型编程语言是如何实现跨平台的?
解释型编程语言可以高级语言保存,要运行时再通过译码器转换成机器语言让计算机运行。只要计算机中拥有相应的译码器,无论什么平台都可以使用。
6.莫斯密码的原理其实是什么?
将要表达的意思融入到·和—的不同排列组合之中,再将其进行传递。
7.视频中小甲鱼“故弄玄虚”的那段密文还原后是什么内容(中文)?
QINMENCHENDIRENCHIFANSHIFADONGJINGONG

WLFNIUBI 发表于 2023-7-7 19:59:40

吧vgn         

心所思,心则安 发表于 2023-7-7 22:34:16

1

阿珍爱上了阿强 发表于 2023-7-7 23:45:59

7

faxpb 发表于 2023-7-8 03:56:27

感谢

鱼师父 发表于 2023-7-8 13:26:29

1

bin2450 发表于 2023-7-8 15:01:50

好啊,fish真好

万事胜意KJQ 发表于 2023-7-8 15:26:17

康康

Y_Hikari 发表于 2023-7-8 15:54:24

1

Victor·Bayim 发表于 2023-7-8 15:59:36

4

unique-melody 发表于 2023-7-8 19:22:33


#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 hadle;
        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(cost 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;
}
页: 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 [1912] 1913 1914 1915 1916 1917 1918 1919 1920 1921
查看完整版本: S1E2:第一个程序 | 课后测试题及答案