axi爱学习 发表于 2022-10-18 16:33:58

0计算机是二进制
1机器语言
2编译
3编译语言可以直接通过cpu执行,解释语言要通过解释器才你翻译
4能,因为C语言系统有80%的相似
5通过解释器翻译,再由CPU执行
6字节符翻译
7亲们趁敌人吃饭时发动进攻

lqq2237 发表于 2022-10-18 16:47:30

2111111

c_chilly 发表于 2022-10-18 19:24:01

参考答案

2292711914 发表于 2022-10-18 19:31:24

1

萌新小花学编程 发表于 2022-10-18 19:45:03

111

曹三仙 发表于 2022-10-18 20:33:03


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

1050709361 发表于 2022-10-18 20:38:28

11

dan_bing 发表于 2022-10-18 20:43:58

111111

761271894 发表于 2022-10-18 20:56:04

西路葫芦 发表于 2022-10-18 21:19:18

答案~

花海Dika 发表于 2022-10-18 22:23:44

答案

Zanyred 发表于 2022-10-18 23:25:46

111

PaciSR 发表于 2022-10-19 10:38:02

回复回复

醉酒的鸽 发表于 2022-10-19 11:32:10

.

今晚夜色很美 发表于 2022-10-19 14:27:57

不知道

小小酥饼干 发表于 2022-10-19 15:45:28

感谢

小奕碎片 发表于 2022-10-19 17:20:59

内容

霸霸6 发表于 2022-10-19 19:38:30

CPU原理上只认识 0和 1
机器码
编译
适用平台不同


摩斯密码的原理是用特殊的符号代表具体的字母

biubiubooma 发表于 2022-10-19 22:00:08

0,只能识别0及1
1,汇编语言
2,编译
3,解释型语言多一步转换过程
4,可以,(具体解释不清楚)
5,不知道
6,特定的符号代表特定的含义,编译解译
7、不知道

啊这啧啧啧 发表于 2022-10-19 22:06:09



页: 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 [1779] 1780 1781 1782 1783 1784 1785 1786 1787 1788
查看完整版本: S1E2:第一个程序 | 课后测试题及答案