dwb8023zht 发表于 2019-3-5 22:07:06

题目已做完,对照答案

qieerxi 发表于 2019-3-5 22:36:51

看看哪里错

秋落无声语 发表于 2019-3-6 00:33:53

dev c++总共执行了0行代码???

18846148440 发表于 2019-3-6 07:32:08

asas

大户人家 发表于 2019-3-6 13:14:49

1

Ben佘 发表于 2019-3-6 14:58:19

0.计算机只识别二进制语言
1.二进制汇编语言
2.编译型语言直接转化为二进制语言, 解释型语言需要翻译器
3.可以, C语言具有可移植性

shige1986 发表于 2019-3-6 15:21:18

看一看如何

胡钟崴 发表于 2019-3-6 15:59:03

讲的很合理清晰

python`learner 发表于 2019-3-6 16:04:03

1.因为计算机只能直接识别机器语言2.机器语言

Amoslin 发表于 2019-3-6 16:12:32

测试题答案

Amoslin 发表于 2019-3-6 16:15:06

回复

麻辣小烤鸭 发表于 2019-3-6 16:44:42

0、一句简单的话,机器要经过非常非常长的进制转换打印输出
1、机器语言
2、编码
3、前者效率更高
4、能
5、通过解释器
6、通过一系列的点和线连接在一起
7、

镌镌镌 发表于 2019-3-6 17:24:51

请问

BYZ 发表于 2019-3-6 17:52:33

对一下答案{:5_97:}

bizhiliang 发表于 2019-3-6 23:15:08

答案

chosenx 发表于 2019-3-7 00:50:44

#include<io.h>
#include<direct.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define MAX 256

总数;


int countLines(const char * filename);
void findAllCodes(const char * path);
void findAllFiles(const char * path);

int countiLines(const char * filename)
{
        FILE * fp;
        int count = 0;
        int temp;

        if ((fp = fopen_s(filename, "r") ) == NULL)
        {
                fprintf(stderr, "无法打开文件:%s\n", filename);
               
                return 0;
        }
        while ((temp = fgetc(fp)) != EOF)
        {
                if (temp == '\n')
                {
                        总数++;
                }
        }
        FCLOSE(fp);
       
        return 总数;

}

void findAllCodes(const char * path)
{
        struct _finddata_t fa;
        int handle;
        char thePath, 目标,总计;
       

        strcpy_s(thePath, path);
        if ((handle = _findfirst(strcat_s(thePath, "\*。c"), &fa)) != -1L)
        {
               
                {
                        sprintf_s(目标,"%s/%s",path,fa.name);
                        总计+= countLines(目标);

                }while (_findnext(handle, &fa) == 0);
        }

        _findclose(handle);

}


void findAllDirs(const char* path)
{
        struct _finddata_t fa;
        int handle;
        char thePath;

        strcpy_s(thePath, path);
        if ((handle = _findfirst(strcat_s(thePath, "/ *"), &fa)) == -1L)
        {
                fprintf(stderr, "路径%s错了!\n", thePath);
                return;

        }

       
        {
                if (!strcmp(fa.name,"。") || !strcmp(fa.name,".."))

                if (fa.attrib == _A_SUBDIR)
                {
                        sprintf_s(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("目前你总共写了%d行代码!\n\n", 总计);
       
        system("pause");

        return 0;


}

12345Sha 发表于 2019-3-7 02:21:00

打卡!

snai10095 发表于 2019-3-7 05:00:56

qinmenchendirenchifgshfanonGwingong

mineCLAY 发表于 2019-3-7 06:07:45

不会啊

Hakeem 发表于 2019-3-7 08:28:45

666666666666666
页: 253 254 255 256 257 258 259 260 261 262 [263] 264 265 266 267 268 269 270 271 272
查看完整版本: S1E2:第一个程序 | 课后测试题及答案