dieformee 发表于 2022-8-31 13:37:02

1

神奇小卷毛 发表于 2022-8-31 14:29:16

{:5_90:}

Latinaqwq 发表于 2022-8-31 15:38:55

获取答案

逃跑抽搐 发表于 2022-8-31 15:41:01

查看答案~

乌托邦x 发表于 2022-8-31 15:55:55

"C:\Users\asus\Pictures\Saved Pictures\QQ图片20220831155433.png""C:\Users\asus\Pictures\Saved Pictures\QQ图片20220831155439.png"我这个明明没错啊,好像大概,我看了两遍,但就是不能运行

染染子 发表于 2022-8-31 15:59:52

查看参考答案。

苍老的小孩1 发表于 2022-8-31 16:01:22

ptintf("I love Fishc.com\n");

开始接触 发表于 2022-8-31 16:14:24

220210208 发表于 2022-8-31 17:30:30

emmm

1041526008 发表于 2022-8-31 17:32:02

1

shishifeng 发表于 2022-8-31 17:58:19

1

zslearnc 发表于 2022-8-31 20:00:46

hello world

千と千尋の神隠 发表于 2022-8-31 20:32:29

感谢楼主无私奉献!

海边的kfk 发表于 2022-8-31 20:58:32

1

爱好学习的澄 发表于 2022-8-31 20:58:59

对答案拉

鬼鬼哒 发表于 2022-8-31 21:04:04

答案

爱衣ai 发表于 2022-8-31 21:21:10

谢谢捏

13719962534 发表于 2022-8-31 21:48:05

0: 因为计算机只认0和1。
1: 机器码。
2:翻译。
3:不知道
4:可以
5:靠字节码
6:映射
7:不知道

chenyouxiu 发表于 2022-8-31 21:49:46

回复

asky533 发表于 2022-8-31 22:09:56

测试题:
static/image/hrline/1.gif
第0题的答案:因为计算机只懂二进制比特位0和1,以及0和1组成的指令,其他啥也读不懂
第1题的答案:机器语言,就是0和1组成的指令
第2题的答案:叫做编译
第3题的答案:编译型语言是把代码翻译成汇编语言再翻译成机器语言,而解释型语言则是现将源码转换为中间代码,再将中间代码发送到解释器,最后由解释器翻译成机器语言
第4题的答案:大部分程序都可以在linux里面执行,但在linux系统里面C语言有更广阔的天地
第5题的答案:它不直接编译成机器码,而是将源码转换成中间代码,然后发送给解释器,由解释器逐句翻译给 CPU 来执行
第6题的答案:原理是像机器语言一样,摩斯密码可以以点横的方式组成密码,然后再通过特定的表破译

第7题的答案:汉语拼音:qin min chen di ren chi fan shi fa dong jin gong   汉语:亲民趁敌人吃饭时发动进攻?
static/image/hrline/1.gif


动动手:
static/image/hrline/1.gif
答案:
#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;
}
大概没错吧^_^
页: 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 [1719] 1720 1721 1722 1723 1724 1725 1726 1727 1728
查看完整版本: S1E2:第一个程序 | 课后测试题及答案