BCwhite 发表于 2019-11-18 12:47:59


BCwhite 发表于 2019-11-18 12:50:56

为什么我是·零·行·代码呢?

Sue96 发表于 2019-11-18 12:53:45

测试题:
第0题:
CPU只能读懂二进制的0和1

第1题:
机器语言(机器码)

第2题:
编译

第3题:
编译型语言写的程序执行之前,需要一个专门的编译过程,把程序编译成为机器语言的文件;
解释型语言首先是通过编译器编译成字节码文件,然后在运行时通过解释器给解释成机器文件。

第4题:
适当修改后可以运行

第5题:
在各个平台上,由解释型语言的解释器将代码翻译给CPU,由CPU执行

第6题:
查表(编码和解码)

第7题:
亲们趁敌人吃饭时发动进攻

动动手:

657943922 发表于 2019-11-18 13:14:43

阿斯顿发斯蒂芬

哈哈哈321 发表于 2019-11-18 14:13:08

做不来做不来

派大星爱吃葡萄 发表于 2019-11-18 15:25:14

学习

图安TuA 发表于 2019-11-18 15:32:28

机器语言 0和1

扭转乾坤 发表于 2019-11-18 18:27:43

1:机器语言
2:编译
3:速度不同
4:否
6:将图形翻译成文字

kdc992 发表于 2019-11-18 19:17:13

打卡

傲娇怪 发表于 2019-11-18 19:23:41

第一天打卡!!!

RRRUAAA 发表于 2019-11-18 20:31:53

,,s

gzk201645 发表于 2019-11-18 20:57:42

看看

huzaizhou 发表于 2019-11-18 21:13:21

因为只能读得懂二进制
机器语言
编译
编译型语言编译后直接将代码转换为机器语言(产生可执行文件),解释性语言将代码转换为字节码,然后由解释器再转换为机器码交给cpu执行
可以
通过字节码交给不同平台的解释器进行编译
编码和解码
QIN MEN CHEN QI REN CHI FAN SHI FA DONG GONG JIN GONG

polaris-- 发表于 2019-11-18 21:16:17

get

里维 发表于 2019-11-18 21:50:38

0.因为计算机只能根据人的二进制指令执行命令
1.汇编语言
2.编译
3.编译型不可以直接编译 解释型可以直接翻译成程序语言
4.不可以
5.
6.

wanlye 发表于 2019-11-18 21:59:21

1

想抓住猫的鱼 发表于 2019-11-18 22:23:14

dyt

小兔熬粥 发表于 2019-11-18 22:27:37


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

向往神鹰 发表于 2019-11-18 23:02:33

<<本地磁盘(E:) >Web编程 > 2、C语言 > 课后作业
我将编译的文件“第二节课”转换为可执行文件后,怎么系统提示:canoe open output file 第二节课: Is a directoty
                                                                                             collect2:ld returned 1 exit status
老师,这个是什么意思?

向往神鹰 发表于 2019-11-18 23:08:37

向往神鹰 发表于 2019-11-18 23:02
我将编译的文件“第二节课”转换为可执行文件后,怎么系统提示:canoe open output file 第二节课: Is a...

已解决
页: 455 456 457 458 459 460 461 462 463 464 [465] 466 467 468 469 470 471 472 473 474
查看完整版本: S1E2:第一个程序 | 课后测试题及答案