Auroraxux 发表于 2022-7-5 14:17:42

查看参考答案

cdpi 发表于 2022-7-5 15:03:50

z1837938296 发表于 2022-7-5 15:37:39

一直报错,找不出拿错了

伞木希美 发表于 2022-7-5 15:49:00

找不到对应文件,显示0行

花小魚 发表于 2022-7-5 16:11:56

本帖最后由 花小魚 于 2022-7-5 16:13 编辑

0. CPU只懂0和1
1. 机器语言
2. 编译
3. 是否直接编译为机器语言
4. 不能
5. 通过解释器
6. 查表
7. 亲们趁敌人吃饭时发动进攻

十口木 发表于 2022-7-5 17:43:12


13592938453 发表于 2022-7-5 18:17:03

已完成

12378910 发表于 2022-7-5 21:14:17

66666666666

MAPTY 发表于 2022-7-5 21:47:51

1

Nakhimov 发表于 2022-7-5 21:58:30

1

不务正业医学生 发表于 2022-7-5 22:33:58

康康做的对不对{:5_102:}

俊远 发表于 2022-7-5 22:37:48

0.计算机只认识0和1
1.机器语言
2.编译
3.编译型语言需要经过编译;解释型语言无需经过编译,跨平台性强.
4.可以 linux上使用gcc指令 window上可使用vscode devc++编译器
5. 通过解释器
6.摩斯密码表
7.亲们趁敌人吃饭时发起进攻

何凛谦 发表于 2022-7-5 22:46:18

111

媛儿妙不可言 发表于 2022-7-5 23:38:14

{:5_102:}

零蛋w 发表于 2022-7-6 01:07:17

因为计算机只能识别二进制的机器码
机器码 机器的语言
编译
编译型语言可以通过编译器直接转换到机器的语言 二解释型语言则利用解释器一句一句地解释为机器的语言 效率低

通过解释器一句一句的翻译
利用编译表将点横组合翻译为铭文
亲们,趁敌人吃饭时发动进攻

零蛋w 发表于 2022-7-6 02:13:45

零蛋w 发表于 2022-7-6 01:07
因为计算机只能识别二进制的机器码
机器码 机器的语言
编译


好吧 不可Orz

qianguan 发表于 2022-7-6 04:34:04

图一时之快先看答案

bwzxhjy 发表于 2022-7-6 07:06:59

109

abyss10086 发表于 2022-7-6 08:51:22


#include <>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <字符串>

#define 最大 256

长总计;

int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);

int countLines(const char *filename)
{
文件 *fp;
整型计数 = 0;
int temp;
      
if ((fp = fopen(filename, “r”)) == NULL)
      {
fprintf(stderr, “Can not open the file:%s\n”, filename);
返回 0;
      }
      
while ((temp = fgetc(fp)) != EOF)
      {
if (temp == '\n')
                {
计数++;
                }
      }
      
fclose(fp);
      
返回计数;
}

void findAllCodes(const char *path)
{
结构_finddata_t法;
长手柄;
char thePath, target;
      
strcpy(thePath, path);
if((handle = _findfirst(strcat(thePath, “/*.c”), &fa)) != -1L)
      {

                {
sprintf(target, “%s/%s”, path, fa.name);
总计 += 计数线(目标);
}while (_findnext(handle, &fa) == 0);
      }
   
_findclose(手柄);
}

void findALLDirs(const char *path)
{
结构_finddata_t法;
长手柄;
char thePath;
      
strcpy(thePath, path);
if((handle = _findfirst(strcat(thePath, “/*”), &fa)) == -1L)
      {
fprintf(stderr, “path %s is error!\n”,path);
返回;
      }
   

      {      
if (!strcmp(fa.name, “.”) || !strcmp(fa.name, “..”))
继续;
                  
if( fa.attrib == _A_SUBDIR)
                {      
sprintf(thePath, “%s/%s”, path, fa.name);
findAllCodes(thePath);
findALLDirs(thePath);
                }
}while (_findnext(handle, &fa) == 0);
   
_findclose(手柄);
}

int main()
{
字符路径 = “.”;
      
printf(“计算中...\n”);
      
findAllCodes(path);
findALLDirs(path);
      
printf(“目前你总共写了 %ld 行代码!\n\n”, total);
系统(“暂停”);
      
返回 0;
}

429776300 发表于 2022-7-6 09:18:11

是啥
页: 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 [1664] 1665 1666 1667 1668 1669 1670 1671 1672 1673
查看完整版本: S1E2:第一个程序 | 课后测试题及答案