努力进阶的猪猪 发表于 2022-1-29 19:09:44

{:5_106:}

xiao0hei 发表于 2022-1-29 20:27:40

核对下答案

vickj2022 发表于 2022-1-29 21:22:41

333

sgggggg2 发表于 2022-1-29 22:04:03

{:5_109:}

帽子戏法LV 发表于 2022-1-30 10:11:34

优秀的文章

2401568216 发表于 2022-1-30 10:59:20

0.因为计算机只认识 0 和1
1.机器语言
2.编译
3.是否在运行前将代码转换为 机器语言
4.不能
5.额,这个不懂
6.查字典 将莫斯密码与译文对应

小阳123 发表于 2022-1-30 13:26:17

目前你总共写了10行代码!

小x爱学习 发表于 2022-1-30 15:57:14

0.CPU只懂二进制的0和1
1.编程语言
2.编译
3.解释型语言不直接编译成机器码,而是将源代码转换为中间代码
4.能
5.先将源代码转换为中间代码,再发送给解释器,由解释器翻译给CPU
6.根据摩斯密码编码表翻译

yhhhibiki 发表于 2022-1-30 17:38:53

1

spikewin 发表于 2022-1-30 22:45:06

看答案

teaboss 发表于 2022-1-30 22:49:39

拾柒。 发表于 2022-1-31 11:29:52

答案

xiaoliufei 发表于 2022-1-31 15:47:42

学习

asdjkm 发表于 2022-1-31 19:07:39

哈哈哈哈哈

15896000990 发表于 2022-1-31 19:38:20

1111111111111111111

宁做 发表于 2022-2-1 10:29:41

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

#define MAX256

long total;


int countLine(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);
                               findAllCodes(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;
}

狼不需鸣 发表于 2022-2-1 10:57:06

xue

getmore 发表于 2022-2-1 12:57:31

11111111111111111111

鹤汀酱 发表于 2022-2-1 13:26:50

1

xiaowen123 发表于 2022-2-1 15:06:28

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

请按任意键继续. . .
页: 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 [1544] 1545 1546 1547 1548 1549 1550 1551 1552 1553
查看完整版本: S1E2:第一个程序 | 课后测试题及答案