楚子航· 发表于 2026-2-28 10:26:58

1

小星辰年 发表于 2026-2-28 12:31:10

0.因为计算机看不懂文字,只能看的懂0和1
1.机器语言
2.编译
3.编译型语言会生成一个可执行文件再运行,而解释型语言通过第三方转换来运行
4.不可以
5.通过解释器来完成,我们写的代码就是文本,所以可以跨平台
6.通过长短信号来组合字母
7.--.- .. -. -- . -. → QINGEN
-.-. .... . -. -.. → CHEND
.. .-. . -. -.-. → IRENC
.... .. ..-. .- -. → HIFAN
... .... .. ..-. → SHIF
.- -.. --- -. --. → ADONG
.--- .. -. --. --- → JINGO
-. --. → NG
"请趁现在还在人间 Jingong"

英武ge 发表于 2026-2-28 19:39:02

查看参考答案

love66666 发表于 2026-3-1 09:59:02

love66666

WYXyy 发表于 2026-3-2 11:20:09

11

lhh2006 发表于 2026-3-2 15:39:20

1

yetionyo 发表于 2026-3-2 17:15:38

1

feimingdi 发表于 2026-3-2 20:10:00

+1

linjian_z 发表于 2026-3-4 15:05:04

查看

zhanghaotiannb 发表于 2026-3-4 21:45:34

1

银鸥白鸟 发表于 2026-3-5 02:32:59

0.采用二进制
1.机器语言
2.编译
3.编译型语言,如c语言,c++,编译器将代码编译成汇编语言,再由汇编语言的编译器编译为机器语言,灵活性高、效率高、可移植性高。解释型语言不直接编译成机器码,而是将源码转换成中间代码,然后发送给解释器,由解释器逐句翻译给 CPU 来执行。这样做的一个好处就是可以实现跨平台的特性,而缺点就是效率相对要低一些,因为每执行一次都要翻译一次。
4.不可以(?)
5.解释器
6.查阅编码表进行解码
7.亲们趁敌人吃饭时发动

银鸥白鸟 发表于 2026-3-5 04:05: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 findALLDirs(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;
}
手搓出来的,为什么运行的一直是总共写了0行代码{:10_266:}

qw123456hx 发表于 2026-3-5 11:22:10

我要看答案

lslll123 发表于 2026-3-5 19:49:14

讲的很好,点赞

年九辞 发表于 2026-3-5 20:08:47

快上课吧了 发表于 2026-3-7 13:57:33

1

快快乐乐小毒师 发表于 2026-3-7 14:36:14

"C:\Users\liyub\Downloads\IMG_20260307_143435.jpg"

sjsj肉肉 发表于 2026-3-7 14:47:59

1

cjjJasonchen 发表于 2026-3-7 15:58:04

看看

梦成终 发表于 2026-3-8 23:32:58

因为只读得懂01
编译
代码执行方式
不能
解释器
页: 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 [2134] 2135 2136 2137 2138 2139
查看完整版本: S1E2:第一个程序 | 课后测试题及答案