小F爱编程 发表于 2021-3-11 21:20:24

计算中···

--------------------------------
Process exited after 5.153 seconds with return value 3221225477
我想知道上面显示的是什么意思

dz2333 发表于 2021-3-11 22:01:42

🐟飞飞飞飞飞飞

希原夏森 发表于 2021-3-11 22:02:51

加油

Aoest 发表于 2021-3-11 22:21:53

66666666666666666666666666

mshhjk 发表于 2021-3-11 22:24:08

1

fiui 发表于 2021-3-11 22:26:40

看看

DragonbornV 发表于 2021-3-11 22:36:30

0.因为计算机只懂得0和1
1.CPU唯一认识的语言是机器码也是机器语言
2.C语言编写的源代码转换为汇编语言的过程叫编译
3.本质区别就是解释型语言不会将源代码直接转化为机器代码而需要解释器进行翻译,效率相对较低。
4.由于C语言的可移植性高,所以能
5.通过将源代码转换成中间代码然后发送给解释器,由解释器逐句翻译给CPU执行,以此来实现跨平台
6.通过符号对我们所用的语言进行加密再通过摩斯密码对照表进行翻译。
7.亲们趁敌人吃饭发动进攻

zyrxc 发表于 2021-3-11 22:38:53

xc

zongxiong 发表于 2021-3-11 22:41:37

1

Alfre4 发表于 2021-3-11 22:58:05

为什么结果是0?

TSwangming 发表于 2021-3-11 23:01:33

答案

Mrayiun 发表于 2021-3-11 23:33:58

ya

y102774105 发表于 2021-3-11 23:43:36

头疼

yongnian 发表于 2021-3-12 01:12:39

zan

w609431227 发表于 2021-3-12 01:52:31

66666666666666666666

fate_xiaoleng 发表于 2021-3-12 07:42:29

回复

秋狐hu 发表于 2021-3-12 09:09:32


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

响鸟 发表于 2021-3-12 09:38:25

{:10_298:}来瞧瞧答案.jpg

xiaowa1 发表于 2021-3-12 09:40:11

111

河水木 发表于 2021-3-12 10:26:05

来看答案了
页: 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 [1107] 1108 1109 1110 1111 1112 1113 1114 1115 1116
查看完整版本: S1E2:第一个程序 | 课后测试题及答案