jackxiya 发表于 2021-10-3 16:54:32

nice

Extravagant 发表于 2021-10-3 17:11:02

0.计算机只认识0和1
1.机器语言
2.编译
3.
4.能
5.
6.有对应的解码机制

库西尤 发表于 2021-10-3 17:22:27

对答案

清风挽月 发表于 2021-10-3 17:35:04

完成

奥noria 发表于 2021-10-3 18:51:11

C:\Users\Administrator\Desktop

低调程序员 发表于 2021-10-3 19:48:53

lalal

唔爱 发表于 2021-10-3 21:02:00


#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{MAX};
       
        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 thenPath
       
        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,".."))
                     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{MAX} = ".";
       
        printf("计算中...\n");
       
        findAllCodes(path);
        findALLDirs(path);
       
        printf("目前你总共写了%1d 行代码!\n\n", total);
        system("pause");
       
        return 0;
}

厦门不倒翁. 发表于 2021-10-3 22:24:15

ok了

飛行士 发表于 2021-10-3 22:50:10

查看参考答案

林天寒 发表于 2021-10-3 23:22:54

看看答案了

aminlee 发表于 2021-10-3 23:45:48

0.计算机只认识0和1
1.机器语言
2.编译
3.不需要解释器
4.不一定可以
5.不知道
6.没说呀
7.视频里没这个东西呀

手可摘星辰16 发表于 2021-10-4 00:49:18

感谢大佬!

vlane 发表于 2021-10-4 08:30:52

看看

sugerzzx 发表于 2021-10-4 08:38:57

参考答案

gis工程师 发表于 2021-10-4 10:17:04

C:\Users\Administrator\Desktop

c575865406 发表于 2021-10-4 10:34:50

0、因为只认识0或1
1、二进制语言
2、编译
3、不知道
4、可以
5、不知道
6、二进制0或1
7、qinmenchendirenchifpshi

万事屋 发表于 2021-10-4 10:44:05

支持小甲鱼

wmh1024 发表于 2021-10-4 10:47:10

每天努力学c

鱼豆腐玛卡巴卡 发表于 2021-10-4 10:56:57

0.它只认识01代码
1.机器语言
2.转义
3.平台不同
4.可以
5.用解释器进行翻译
6.不知道

joca灿 发表于 2021-10-4 11:01:54

#include <stdio.h>

int main()
{
   printf("XXXXXX");
   return 0;
}
页: 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 [1400] 1401 1402 1403 1404 1405 1406 1407 1408 1409
查看完整版本: S1E2:第一个程序 | 课后测试题及答案