Ⅲ只小猪 发表于 2020-8-26 16:02:03

以为它只能识别机器码
机器语言
编译型语言会转换成汇编语言
可以
使用了解释器
机器码

guobin 发表于 2020-8-26 16:24:57

看看

我是预言家 发表于 2020-8-26 16:30:42

1

怪物猎人world 发表于 2020-8-26 16:46:55

答案

jackynie 发表于 2020-8-26 17:30:32

学习了学习了

ckfishcCCC 发表于 2020-8-26 17:35:54

dd

爱臭美的臭豆腐 发表于 2020-8-26 18:21:55

回复

wang6wan 发表于 2020-8-26 20:48:19

看看答案

QWE010020003 发表于 2020-8-26 22:00:38

.

萌了个兔 发表于 2020-8-26 22:32:52

谢谢

Suki11 发表于 2020-8-26 23:00:31


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

FishC0911 发表于 2020-8-26 23:28:09

0.计算机的所有顺序均转化为2进制才能看懂
1.机器语言
2.编译
3.编译型语言需要将语言编译为机器语言才能让计算机明白,解释型语言不需要进行编译过程
4.可以运行
6.通过点号和横形成2进制排列组合形成

黄柠柠 发表于 2020-8-27 01:01:06


1048739383 发表于 2020-8-27 09:00:18

感谢小甲鱼,因为工作的原因 还是要把这个捡起来学习,加油~

lbwei 发表于 2020-8-27 09:54:59

错好多

kerbal998 发表于 2020-8-27 10:16:59

keyikeyi

Schrieffer 发表于 2020-8-27 10:22:20

1

黑眼睛 发表于 2020-8-27 10:24:25

LamGaaSing 发表于 2020-8-27 11:10:31

{:5_90:}

yuanxp 发表于 2020-8-27 11:12:45

已写,康康答案
页: 817 818 819 820 821 822 823 824 825 826 [827] 828 829 830 831 832 833 834 835 836
查看完整版本: S1E2:第一个程序 | 课后测试题及答案