10大强 发表于 2020-8-23 22:22:38

{:5_95:}

Fishc510fff 发表于 2020-8-23 23:28:53

感谢

x1c582 发表于 2020-8-24 01:07:12

{:9_222:}

学徒1 发表于 2020-8-24 08:25:21

忘记了一些

奇诺之旅 发表于 2020-8-24 09:14:03

测试

soulreaper123 发表于 2020-8-24 09:32:55

回复

1305687621 发表于 2020-8-24 10:00:06

对答案

1484720971 发表于 2020-8-24 10:15:06

答案

字不语 发表于 2020-8-24 10:49:35

查看答案

mimiao 发表于 2020-8-24 10:55:16

0.只能识别机器语言
1.机器语言(二进制0和1)
2.编译
3.CPU能否直接执行
4.可以
5.解释器
6.编码
7.亲们趁敌人吃饭时发动进攻

Lugduname 发表于 2020-8-24 11:08:02

{:5_109:}

小小君子 发表于 2020-8-24 11:13:28

#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX      256

long tatle;

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

学渣渣渣 发表于 2020-8-24 14:01:52

{:10_277:}

爱玩车的程序员 发表于 2020-8-24 15:21:40

努力学习,冲~!!!2020.8.24

有梦想的小魔女 发表于 2020-8-24 16:37:17

回复看答案嘿嘿

JiuChorYuen 发表于 2020-8-24 17:36:47

为什么我们说计算机其实是“二傻子”

song4050343 发表于 2020-8-24 17:38:45

11111

夏梦yume 发表于 2020-8-24 18:12:04

好!

凑阿夸 发表于 2020-8-24 18:12:59

让我康康答案

JK一L 发表于 2020-8-24 18:25:15

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