奥特曼123456 发表于 2021-9-17 19:32:24

+1

LonelyOB 发表于 2021-9-17 19:39:34

求答案

北城jim 发表于 2021-9-17 20:12:02

0.因为计算机只懂得0和1
1.机器语言
2.编译
3. 编译型语言在程序执行之前,有一个单独的编译过程,将程序翻译成机器语言,以后执行这个程序的;
解释型语言,是在运行的时候将程序翻译成机器语言
4.不可以
5.解释型语言在运行的时候将程序翻译成机器语言,所以可以实现跨平台
6.查表
7.亲们,趁敌人吃饭时发动进攻

13166106905 发表于 2021-9-17 20:14:14

shui

chenjunhuicool 发表于 2021-9-17 20:37:58

yao

rdfguyhj 发表于 2021-9-17 20:43:36


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

虎牙赖神很捞 发表于 2021-9-17 20:58:27

想看答案

吃花椒的定点数 发表于 2021-9-17 21:30:02

0.机器语言
1.编译
3.目标文件
4.不能
5.可执行文件
6.编译
7.不知道

靓仔仔 发表于 2021-9-17 21:38:56

1

ikaja 发表于 2021-9-17 21:51:42

给我看看答案

yuxiou 发表于 2021-9-17 22:30:17

Hello,world

1251504060 发表于 2021-9-17 23:14:29

66666666

Mari0 发表于 2021-9-17 23:18:48

6666666666

代号lml 发表于 2021-9-17 23:20:33

112

weber.code36 发表于 2021-9-18 01:49:50

0. 因为计算机只认识0和1
1. 机器语言。
2. 编译。
3. 编译型语言,运行效率高,迁移性好。可以直接将人编写的语言,编译成汇编语言然后翻译成机器语言。解释型语言,是先将人编写的语言需要解释器,才能解释成机器能够看懂的语言。运行效率较低。
4.可以。
5. 通过不同的解释器来实现跨平台。
6. 通过指令表来进行翻译。
7. Q i n m e n
c h e n d
i r e n c
h i q a n
s h i f
a d o n g
j i n g o ng

键盘上的米粒 发表于 2021-9-18 03:37:47

朕想知道

吴贤炬 发表于 2021-9-18 07:37:27

大佬牛逼

mylxuebiancheng 发表于 2021-9-18 09:50:17

1

Net网安 发表于 2021-9-18 10:02:55

课后测试题答案

辰亦Cheney 发表于 2021-9-18 10:39:27

课后测试题及答案
页: 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 [1374] 1375 1376 1377 1378 1379 1380 1381 1382 1383
查看完整版本: S1E2:第一个程序 | 课后测试题及答案