xuman123 发表于 2021-6-28 10:38:41

1

取名鬼才 发表于 2021-6-28 11:13:13

0.只懂0和1
1.机器语言
2.编译
3. 编译型语言直接编译成机器码,java转译成字节码再通过编译器编译成机器语言
4. 能
5.通过转化成字节码在通过解释器编译成机器语言
6.查表
7.qinmenk=chendirenchifanshifadongjingong,亲们趁敌人吃饭时发动进攻

小叶子不高兴 发表于 2021-6-28 12:54:54

。。

a1031847962 发表于 2021-6-28 14:17:15

72为什么一直错

chen6762382 发表于 2021-6-28 15:02:58

看下答案

1137272554 发表于 2021-6-28 15:59:33

11111

qln525 发表于 2021-6-28 16:00:56

思考过啦

花开花落呦 发表于 2021-6-28 16:02:39

111

abcのC 发表于 2021-6-28 16:14:03

想知道莫斯密码的答案

cpdddddddd 发表于 2021-6-28 16:24:22

答案

唯有无奈 发表于 2021-6-28 16:48:14

代码:
#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 fill:%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,"/*"),&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;
       
}

结果:
计算中...
你总共写了0行代码

按任意键继续

铁蛋他爹 发表于 2021-6-28 17:51:14

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

科比·布莱恩特 发表于 2021-6-28 17:52:13

答案

csjczj 发表于 2021-6-28 18:01:03

看看答案

Beliefs 发表于 2021-6-28 18:05:24

0.计算机只认01
1.0和1
2.编译
3.
4.可以
5.
6.编码和解码
7.emmm

非常高冷肥宅 发表于 2021-6-28 19:58:12

敲键盘敲错了好多字啊

想吃你的泡芙 发表于 2021-6-28 20:48:58

答案在哪呀

1494895398 发表于 2021-6-28 20:50:44

0.因为cpu只懂得二进制的0和1
1.机器码
2.编译
3.是否直接编译成机器码被cpu读懂
4.可以
5.语言→字节码→解释器→cpu执行
6.将铭文对应成点横的不同组合,再查表解码
7.亲们趁敌人吃饭时发动进攻

星梦66 发表于 2021-6-28 21:39:08

BerealChen 发表于 2021-6-28 22:04:33

0
页: 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 [1227] 1228 1229 1230 1231 1232 1233 1234 1235 1236
查看完整版本: S1E2:第一个程序 | 课后测试题及答案