kmckmc 发表于 2022-9-19 17:38:57

daan

DiceNOOO 发表于 2022-9-19 17:44:44

102

7870 发表于 2022-9-19 19:11:08

1

yfqyfqyfq 发表于 2022-9-19 20:04:49

0.因为计算机只能识别0和1
1.机械语言 c语言只是用来控制机械语言的
2.编译
3.
4.可以
5.
6.就是0和1的不同顺序传递不同的信息
7.

karios 发表于 2022-9-19 20:29:42

查看答案

stevezzs 发表于 2022-9-19 20:42:52

看答案

27860082 发表于 2022-9-19 20:48:14

鱼C有你更精彩

伤突破的蛇 发表于 2022-9-19 21:32:47

查看参考答案

2450760066 发表于 2022-9-19 22:16:40

看下答案

lxMission 发表于 2022-9-19 22:50:18

1

llwj520 发表于 2022-9-19 23:09:11

1

Dreamta左丘 发表于 2022-9-20 07:53:59

测了一下只有0行代码,看看咋回事

xianyv2414 发表于 2022-9-20 08:54:07

答案

隆美尔 发表于 2022-9-20 09:32:50


#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 notopen 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("目前你总共写了 %1d 行代码!\n\n", total);
        system("pause");

        return 0;
}

风城 发表于 2022-9-20 10:04:55

测试题答案

echo.c 发表于 2022-9-20 10:08:16

0、只能直接识别二进制
1、机器语言
2、编译
3、编译型语言通过编译产生程序,解释型语言通过解释运行不产生.exe
4、可以,C语言可移植性高
5、通过解释器
6、二进制

莲江5 发表于 2022-9-20 10:27:04

不会

音乐人冰果 发表于 2022-9-20 11:25:08

Hcney 发表于 2022-9-20 12:20:32

.

Dht031230 发表于 2022-9-20 13:00:24

.
页: 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 [1750] 1751 1752 1753 1754 1755 1756 1757 1758 1759
查看完整版本: S1E2:第一个程序 | 课后测试题及答案