3120 发表于 2020-10-21 18:57:34

答案,回复

Plankton_boss 发表于 2020-10-21 19:17:49

6

mbyul 发表于 2020-10-21 19:26:23

查看参考答案

jimili 发表于 2020-10-21 20:08:27

发动

lingc295 发表于 2020-10-21 20:14:16

1

路渣渣 发表于 2020-10-21 21:59:41

小甲鱼第一次作业作答
一.        因为,计算机不能识别人的语言,只能识别代码或二进制语言
二.        二进制
三.        编译
四.        编译是把人语言改成计算机理解的语言,而解释是把一个平台语言改成另一个平台能够接受的语言
五.        可以
六.        通过解释器

黑椒牛排三分熟i 发表于 2020-10-21 22:09:53

芜湖

MARKit 发表于 2020-10-21 22:46:38

dd

竹曦 发表于 2020-10-21 22:47:33

终于搬完了,继续努力

不爱吃酥鱼 发表于 2020-10-21 22:59:28


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

kazusa丶 发表于 2020-10-21 23:10:42

..

imdj 发表于 2020-10-21 23:31:18

1.以为计算机是二进制
2.cpu唯一认识的语言是最底层的开发语言,叫"编绘语言”。
3.编译

某某某某某某人 发表于 2020-10-21 23:58:37

...

cczzyzq 发表于 2020-10-22 07:32:32

好坑呀

SnowH 发表于 2020-10-22 08:28:06

111

ZyWoooO 发表于 2020-10-22 08:56:56

有没有大佬帮帮我
struct _finddata_t fa;
storage size of 'fa' isn't known
我手输的是错的 复制甲鱼的就行了 但是一模一样啊

1134815930 发表于 2020-10-22 09:51:28

我想看一下答案

cz981016 发表于 2020-10-22 11:03:45

1

westry 发表于 2020-10-22 11:15:46

666

jiaodaogang 发表于 2020-10-22 12:02:11

开始学习c语言!加油!
页: 907 908 909 910 911 912 913 914 915 916 [917] 918 919 920 921 922 923 924 925 926
查看完整版本: S1E2:第一个程序 | 课后测试题及答案