ljz1 发表于 2019-9-24 09:31:20

1

起名废废废 发表于 2019-9-24 09:36:59

0 计算机工作基于二进制,从根本上说,计算机只能识别和接受由0和1组成的指令
1 机器语言
2 编译
3 编译型语言在程序执行之前,有一个单独的编译过程,将程序翻译成机器语言,以后执行这个程序的时候,就不用再进行翻译了。解释型语言,是在运行的时候将程序翻译成机器语言,所以运行速度相对于编译型语言要慢。
4 不可以
5 通过不同的编译器
6 数字对应单词,需要查找一本代码表才能知道每个词对应的数。用一个电键可以敲击出点、划以及中间的停顿。
7 亲们趁敌人吃饭时发动进攻

起名废废废 发表于 2019-9-24 09:40:18

102

messi0611 发表于 2019-9-24 12:10:25

6666666666666666

嘤嘤嘤.... 发表于 2019-9-24 12:28:28

000

辰星. 发表于 2019-9-24 12:37:06

1

JYMine 发表于 2019-9-24 13:19:22

看答案

q1030109273 发表于 2019-9-24 13:36:01

{:9_227:}

风不会说话 发表于 2019-9-24 13:51:02

我就想看答案

xiaoyec126 发表于 2019-9-24 14:09:46

回复

心太羁 发表于 2019-9-24 14:33:33

答案

背一个锅 发表于 2019-9-24 15:06:37

        无条件支持楼主!

rain5 发表于 2019-9-24 15:23:17

.

909183133 发表于 2019-9-24 15:26:19


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

wayne-biu 发表于 2019-9-24 16:12:23

答案

liritian6661 发表于 2019-9-24 16:20:55

谢谢老师咯{:5_109:}

fbczr 发表于 2019-9-24 18:00:32

签到

剑无极 发表于 2019-9-24 18:44:14

查看答案

602591560 发表于 2019-9-24 19:37:11

我要看答案{:9_227:}

Myronnnnn 发表于 2019-9-24 20:30:36

看看看
页: 400 401 402 403 404 405 406 407 408 409 [410] 411 412 413 414 415 416 417 418 419
查看完整版本: S1E2:第一个程序 | 课后测试题及答案