菜鸟萌新 发表于 2022-12-13 16:13:23

想知道

836269409 发表于 2022-12-13 16:52:28

问答题答案:



动动手答案:没看懂{:5_94:}


星域巷 发表于 2022-12-13 17:18:13

问答题答案:
0:只能执行命令
2:翻译
3:是否需要再翻译一遍


动动手答案:


Galaxy.10086 发表于 2022-12-13 17:19:56

问答题答案:



动动手答案:
查看参考答案

dyvdy 发表于 2022-12-13 18:24:39

问答题答案:



动动手答案:
#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;
}


864431730 发表于 2022-12-13 21:27:40

问答题答案:



动动手答案:


jin588 发表于 2022-12-13 22:58:16

问答题答案:给我看



动动手答案:


dfghasd 发表于 2022-12-14 08:54:55

asd

问答题答案:



动动手答案:


DLL.1 发表于 2022-12-14 09:55:39

问答题答案:查看答案



动动手答案:


DLL.1 发表于 2022-12-14 09:56:00

问答题答案:查看答案



动动手答案:


Herzogkiss江南 发表于 2022-12-14 13:09:19

1问答题答案:



动动手答案:


zxi 发表于 2022-12-14 13:53:23

问答题答案:



动动手答案:


zxi 发表于 2022-12-14 13:53:40

问答题答案:



动动手答案:


chengxiaoye 发表于 2022-12-14 14:29:43

问答题答案:


每天学习
动动手答案:
每天学习

冻柠茶yuni 发表于 2022-12-14 15:40:26

问答题答案:



动动手答案:


MrLeung 发表于 2022-12-14 16:25:01

问答题答案:



动动手答案:
102

isdkz 发表于 2022-12-14 16:32:16

问答题答案:
0、计算机只认识二进制
1、机器语言
2、编译
3、编译型语言先编译成机器码后执行,解释型语言先编译成字节码再由解释程序逐行执行
4、不能
5、不同平台上的解释器接口都是一样的
6、对表
7、



动动手答案:


舍利7 发表于 2022-12-14 18:35:57

问答题答案:
{:5_108:}


动动手答案:


18253683283 发表于 2022-12-14 19:01:29

问答题答案:



动动手答案:


梦初醒12 发表于 2022-12-14 20:47:22

问答题答案:



动动手答案:
看不懂救命

页: 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 [1815] 1816 1817 1818 1819 1820 1821 1822 1823 1824
查看完整版本: S1E2:第一个程序 | 课后测试题及答案