mo334 发表于 2020-2-5 16:50:12

xzcczcxzcxz

phliny 发表于 2020-2-5 16:58:26

测试题:
0,因为计算机只能识别1和0两个机器码。
1,机器语言。
2,编译。
3,解释型语言的代码需要经过解释器处理,而编译型语言的代码不需要。
4,不可以。
5,不懂。
6,用密码代替字母,字母与密码一一对应。
7,亲们,趁敌人吃饭时发动进攻。

带番薯 发表于 2020-2-5 17:07:12

起飞 芜湖

菠萝驴 发表于 2020-2-5 17:15:16

0.0

DynastyK 发表于 2020-2-5 17:30:26

1

itachijt 发表于 2020-2-5 17:33:19

111111111111111111111111111111

2416315024 发表于 2020-2-5 17:56:28

学习学习!!!!

此鱼非彼鱼my 发表于 2020-2-5 18:21:50

答案见图片

艾小宇 发表于 2020-2-5 18:32:34

败了

莱布妮子接班人 发表于 2020-2-5 18:32:54

1

kalo~ 发表于 2020-2-5 19:36:09

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

13123361597 发表于 2020-2-5 19:53:23

解锁

1029674783 发表于 2020-2-5 19:53:32

不对
Windows:版权属于:bbs.fishc.com
?}LJuEfWN;$_YMrzB5(2]j

#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;
}
复制代码

1029674783 发表于 2020-2-5 19:54:07

显示0

1029674783 发表于 2020-2-5 19:56:36


复制你的代码也显示0{:5_91:}

知河 发表于 2020-2-5 19:57:08

啊啊啊啊啊

跑吧 发表于 2020-2-5 19:59:05

大概是因为计算机会有很多Bug出现

susir哈 发表于 2020-2-5 20:14:36

0、        计算机不能变通,只能按照既定程序运行。
1、        机器语言。
2、        链接
3、        不知道。
4、        否
5、        不知道
6、       

牛肉炸鱼 发表于 2020-2-5 20:41:54

只认一种语言
机器语言
效率高
不行
有解释器
有特殊的字符转换
亲们敌人吃饭时发动进攻

还不错哦 发表于 2020-2-5 20:57:05

每天坚持,加油
页: 537 538 539 540 541 542 543 544 545 546 [547] 548 549 550 551 552 553 554 555 556
查看完整版本: S1E2:第一个程序 | 课后测试题及答案