刘大王 发表于 2021-10-9 20:14:35

看答案

2091611135 发表于 2021-10-9 20:47:26

1

记忆的橡皮擦 发表于 2021-10-9 20:53:22

答案

SnowLC 发表于 2021-10-9 21:20:53

答案

123ABCS 发表于 2021-10-9 21:25:35

自认识0与1

NBZQQ 发表于 2021-10-9 21:25:46

0、只认识0和1两个数
1、汇编语言
2、编译
3、
4、不能够
5、
6、

2531743021 发表于 2021-10-9 21:46:10

66666

你知道吗我会 发表于 2021-10-9 22:31:03

为什么那个求代码总和我只有当天可以求啊 今天打开就是0了,,,,,,,

2162758455 发表于 2021-10-9 22:35:13

行了

动感光波噢? 发表于 2021-10-9 22:58:21

0

1464390545 发表于 2021-10-9 23:02:16

ε=(′ο`*)))唉

Hffishc 发表于 2021-10-9 23:38:43

😉

傻逼叁 发表于 2021-10-9 23:45:24

haha~it's good!

tang818875 发表于 2021-10-10 01:28:58

0. 计算机采用高低电频来表示1/0,并且又1/0组合来表示一切含义,包括指令、数据,计算机只理解0/1两个二进制数, 大概是因为这个吧。

1. 机器语言.

2. 编译过程.

3. 编译:一切"翻译", 完整执行.
    解释:逐句"翻译", 逐句执行.

4. 不行

5. 不知道

6. 事先建立明文和密文的对应集.

7. 你猜, 不会是:我爱鱼C工作室吧.

ZSAS 发表于 2021-10-10 08:52:08

答案

大滑头 发表于 2021-10-10 10:10:56

棒棒哒

2717812465@ 发表于 2021-10-10 10:48:27

S1E2:第一个程序|课后测试题及答案

2568715672 发表于 2021-10-10 11:15:23


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

111098 发表于 2021-10-10 11:20:36

测试题答案

电气龟 发表于 2021-10-10 11:50:04

6
页: 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 [1410] 1411 1412 1413 1414 1415 1416 1417 1418 1419
查看完整版本: S1E2:第一个程序 | 课后测试题及答案