语恋 发表于 2019-2-4 14:20:33

小白感觉好难受

ShawnSue 发表于 2019-2-4 16:33:05

学习一下

空skd 发表于 2019-2-4 17:11:29

回复

wendytang98 发表于 2019-2-4 20:44:04

.......

笺札丶 发表于 2019-2-5 01:04:35

0.因为人让计算机做什么计算机就做什么
1.机器语言
2.编译
3.解释型语言是将其转换成字节码
4.可以
5.因为有字节码
6.利用编码
7.亲们趁敌人吃饭时发起进攻

影夜悠 发表于 2019-2-5 02:15:01

计算中...
目前你总共写了101行代码!

TYUP 发表于 2019-2-5 09:35:04

0.只能识别0和1
1.机器语言
2.编译
3.编译的过程不同
4.可以
5.
6.解释翻译
7.亲们趁敌人吃饭时进攻

子鸿Hattie 发表于 2019-2-5 21:34:34

感觉码完有点奇怪啊,还是来看一看答案吧

星落无痕 发表于 2019-2-6 16:11:25

求答案

未知信号 发表于 2019-2-6 16:55:40

视频好详细{:10_275:}

Eltnevergiveup 发表于 2019-2-6 16:58:49

谢谢,

九少 发表于 2019-2-6 19:41:41

#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 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;
}

风难止 发表于 2019-2-6 20:04:55

打卡

风难止 发表于 2019-2-6 20:15:17

我执行出来之后是提示您总共写了12358行代码??{:5_99:}

zjccc 发表于 2019-2-7 09:56:31

抄完了,卡在47行

YJC_SWU 发表于 2019-2-7 10:44:01

1

yry2501 发表于 2019-2-7 10:44:35

hao

江户川 发表于 2019-2-7 12:08:05

0.计算机只知道机器语言
1.机械语言
2.编译
3.编译型语言电脑可以直接被识别,解释型语言电脑不能直接识别,要通过解释器翻译成机器语言
4.可以
5.用解释器
6.变量代还
7.

泡面君 发表于 2019-2-7 13:20:19

来了来了

小小程序员i 发表于 2019-2-7 13:30:47

答案答案
页: 234 235 236 237 238 239 240 241 242 243 [244] 245 246 247 248 249 250 251 252 253
查看完整版本: S1E2:第一个程序 | 课后测试题及答案