Finley~ 发表于 2024-1-4 11:01:07

{:5_100:}

李大打 发表于 2024-1-4 16:16:36

0.不懂人话
1.二进制
2.编码
3.有无翻译器
4.能
5.

stm32-linux 发表于 2024-1-4 17:39:26

来,让我康康

龙队一号 发表于 2024-1-4 17:39:30

答案

自信例无虚发 发表于 2024-1-5 09:25:00

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

菠萝饺子 发表于 2024-1-5 15:33:21

{:5_106:}

挪麦 发表于 2024-1-5 17:10:19

1

顶聪明的芥子 发表于 2024-1-5 20:55:19

{:5_109:}

闪光少年 发表于 2024-1-6 10:04:42

感谢大佬的教学

小白2024.1.6 发表于 2024-1-6 14:15:45

本帖最后由 小白2024.1.6 于 2024-1-6 14:26 编辑

(0),他只能读懂0和1的二进制语言2 (1),机器语言 (2),编译 (3),编译型语言只需要翻译一次而解释性语言需要执行一次解释一次 (4),可以(5),jajv把程序转化为字节码然后发送给解释器由解释器逐句翻译给CPU(6),将铭文对照编码表实现编码,将密文转换为原文为解码(7)亲们趁敌人吃饭时发动进攻

oneywa 发表于 2024-1-6 15:32:00

第零题:
因为他只懂二进制
第一题:
机器语言
第二题:
编译
第三题:
编译型语言:
C --> 汇编语言 --> 机器码
解析型语言:
Java --> 字节行 --> 解析器 --> 机器码
第四题:
大部分可以
第五题:
因为解释型语言是直接翻译为机器码的
第六题:
编码 解码
第七题:
亲门陈地人是发动进公
第八题:
计算中...
目前你总共写了109行代码!

请按任意键继续. . .

aa345783069 发表于 2024-1-6 17:40:00



0,因为计算机很快,但是不聪明。只认识0和1
1,机械语言
2,编译
3,一个是机器的语言,一个是人的语言
4,是
5,
6用·和-来代替字母
7,qin,men
chen,d
i,ren,chi,fan
shi,fa,dong,jing,ong




#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>

#define MAX 256

long total;

int countLines(const char *filename);
int isCode(const char* filename);
void findAllDirs(const char*path);
int count=0;
int temp;


int countLines(const char *filename)
{
        FILE *fp;

       
        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;
}
int isCode(const char *filename)
{
        int length;

        length = strlen(filename);

        if (!strcmp(filename + (length -2), ".c"))
        {
                return 1;
        }
        else
        {
                return 0;
        }
}

void findAllDirs(const char *path)
{
        DIR *dp;
        struct dirent *entry;
        struct stat statbuf;

        if ((dp = opendir(path)) == NULL)
        {       
                fprintf(stderr,"The path %s is wrong!\n",path);
                return;
        }

        chdir(path);
        while ((entry=readdir(dp) ) !=NULL)                               
        {
                lstat(entry->d_name,&statbuf);

                if(!strcmp(".",entry->d_name)||strcmp("..",entry->d_name))
                        continue;

                if(S_ISDIR(statbuf.st_mode))
                {       
                        findAllDirs(entry->d_name);
       
                }
                else
                {
                        if(isCode(entry->d_name))
                        {       
                                total += countLines(entry->d_name);
                        }
                }
        }       
       
        chdir("..");
        closedir(dp);
}

int main()
{
        char path = ".";

        printf("计算中。。.\n");
        findAllDirs(path);
        printf("目标你总共写了%ld 行的代码!\n\n",total);
        return 0;       
}

逍遥幻梦 发表于 2024-1-6 23:20:04

1

你怕个球啊 发表于 2024-1-7 11:32:29

看看大家的

Xx1234567 发表于 2024-1-7 18:26:09

报错

serein黄昏 发表于 2024-1-7 19:06:08

0 只认识二进制
1 二进制
2 编译
4 可以
5 逐句翻译
6 编译性

一大坨 发表于 2024-1-7 20:59:59

{:10_277:}

Sehnsucht12 发表于 2024-1-7 22:11:40

111

空心. 发表于 2024-1-8 11:49:16

做完了

timeroom 发表于 2024-1-8 14:03:21

@FishC,c语言怎么实现数组的元素删除
页: 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 [1992] 1993 1994 1995 1996 1997 1998 1999 2000 2001
查看完整版本: S1E2:第一个程序 | 课后测试题及答案