GchengYi 发表于 2020-8-13 20:15:55

查看隐藏内容

明天L 发表于 2020-8-13 20:49:32

测试题:
0: 计算机只认识0和1
1、机器语言
2、编译
3、编译型语言源程序直接编译成机器语言,解释型语言先在虚拟机中编译成字节码文件,在解释成CPU所能执行的指令
4、不能,因为C是编译型语言
5、先翻译成字节码,再解释为CPU所能执行的指令,从而实现了夸平台性
6、莫斯密码的原理是由点横不同的排列来组成代表字母A-Z,最后拼合在一起形成一个完整的英文,实现了加密解密
7、qin men chen di ren chi fan shi fa dong jin gong 请门城的人吃饭时发动进攻

Mathysics 发表于 2020-8-13 20:59:58

{:7_131:}

1040300748 发表于 2020-8-13 21:15:28

1

lopers16 发表于 2020-8-13 22:12:24

加油每一天

寒江雪cc 发表于 2020-8-13 22:16:17

0.因为二进制
1.机器码
2. 编译
3.C语言可直接执行语言,解释型语言不直接执行语言,每次执行需要将源代码转化为中间代码
4.可以
5.
6.查表
7.

木下三分 发表于 2020-8-13 23:31:27

1

1498268198 发表于 2020-8-14 09:03:46

看答案

劳尔101 发表于 2020-8-14 09:12:26


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

evy 发表于 2020-8-14 09:52:43

file:///C:/Users/16345/Desktop/%E6%89%B9%E6%B3%A8%202020-08-14%20095105.png
你好!这个搞了几天了!还是不知道哪里问题

evy 发表于 2020-8-14 09:55:07

你好!这个能帮我看看么

方晓东 发表于 2020-8-14 10:51:18

答案

饭团君ちゃん 发表于 2020-8-14 11:11:07

1

蠢萌喵 发表于 2020-8-14 11:19:25

答案

3457109829 发表于 2020-8-14 11:28:20

1219655096 发表于 2020-8-14 13:07:30

看看

lantuuuuu 发表于 2020-8-14 13:50:41

答案

ysc1 发表于 2020-8-14 14:03:45

做完了

ysc1 发表于 2020-8-14 14:13:56

本帖最后由 ysc1 于 2020-8-14 14:15 编辑

完成

帅气本人 发表于 2020-8-14 14:37:59

爱你
页: 802 803 804 805 806 807 808 809 810 811 [812] 813 814 815 816 817 818 819 820 821
查看完整版本: S1E2:第一个程序 | 课后测试题及答案