下里巴人. 发表于 2021-8-15 13:55:50

暗号

代码白白 发表于 2021-8-15 14:01:59

本帖最后由 代码白白 于 2021-8-15 14:04 编辑

1164736245 发表于 2021-8-15 15:00:25

查看参考答案

三叶丶落非花 发表于 2021-8-15 16:05:22

查看答案。这是我运行的结果176行代码

宇宙大队长 发表于 2021-8-15 16:06:18

回复回复回复回复

CieraWilly 发表于 2021-8-15 16:07:17

本帖最后由 CieraWilly 于 2021-8-15 16:25 编辑

测试题:
只读得懂0和1
机器语言
编译
编译型语言先被编译成汇编语言,最终被编译成机器语言,而解释型语言先被转换为中间代码,再由解释器一句一句解释给CUP
能 改: 不能,准备工作不同,文件格式不同
解释器
二进制

青山看白云 发表于 2021-8-15 16:12:20


#include <in.o>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX      256

lng total;

int countlines(const char *filename);
void findAllCodes(const char *path);
vid findALLfiles(const char *path);

int countlines(const char *filename)
{
             FILE *fp;
               int cunt = 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 findAllCdes(const char *path)
{
          struct_finddata_t fa;
                long handle;
                char thePath;

                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);
                        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;

}

言不取苟合 发表于 2021-8-15 16:17:34

查看参考答案

fishc_123 发表于 2021-8-15 16:29:53

1

大傻强 发表于 2021-8-15 16:43:34

daan

1466319547 发表于 2021-8-15 17:00:48

131

jiaheng 发表于 2021-8-15 17:05:56

发送不了图片啊

afly36 发表于 2021-8-15 17:17:52

0 只认识机器语言
1 机器语言
2 编译
3 效率
4 不能
5 解释器可以安装在不同平台,来解释其他平台的代码

palefire 发表于 2021-8-15 17:34:01

{:9_228:}

让记忆定格 发表于 2021-8-15 19:08:15

看看答案

shuangmocyuyan 发表于 2021-8-15 19:55:22

回复?

1311376263 发表于 2021-8-15 20:27:13

加油

等到烟火清凉ye 发表于 2021-8-15 20:49:03

来了

安无 发表于 2021-8-15 21:21:28

{:5_90:}

本C 发表于 2021-8-15 21:31:33

已做!
页: 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 [1318] 1319 1320 1321 1322 1323 1324 1325 1326 1327
查看完整版本: S1E2:第一个程序 | 课后测试题及答案