sykc 发表于 2022-8-15 10:18:49

1

丘三 发表于 2022-8-15 10:41:42

第一课打卡!{:5_106:}

creeperqwq 发表于 2022-8-15 11:42:23

0,计算机只认识0和1
1,机器语言
2,编译
3,编译语言的转化过程不同
4,可以
5,以JAVA为例,通过统一的字节码,然后用解释器编译成机器语言
6,各种字母与各种点横的对应
7,亲们趁敌人吃饭时进攻

Echo_1024 发表于 2022-8-15 13:02:49

感谢分享

12chara 发表于 2022-8-15 14:31:01

?

无瑕丶 发表于 2022-8-15 15:37:06

{:10_266:}

欲上青天 发表于 2022-8-15 16:31:26

计算中...

ShinKaiSora45 发表于 2022-8-15 16:46:45

感谢教程

lingli.wu 发表于 2022-8-15 17:18:27

C:\c\collect2.exe        ld returned 1 exit status

晚风轻踩云朵 发表于 2022-8-15 17:59:58

来看看答案

GokouRuriii 发表于 2022-8-15 19:46:21

1

FWJ-Einstein 发表于 2022-8-15 21:16:32

666

彭于晏YuuAn 发表于 2022-8-15 21:46:28

1

rzhhitchina 发表于 2022-8-15 23:34:55

答案。。。。。。。。。。。。。

wu吴彦祖 发表于 2022-8-16 00:02:14

0.0

Agony_T 发表于 2022-8-16 09:49:24

{:5_95:}

417880 发表于 2022-8-16 09:55:45

陆一游 发表于 2022-8-16 10:37:58

第一天学习开始打卡{:10_256:}

23. 发表于 2022-8-16 12:28:04

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

#define MAX      256

long total;

int counrLines(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("目前你总共写了 %1d 行代码!\n\n", total);
          system("pause");
          
          return 0;
}

py2625 发表于 2022-8-16 14:57:11

啊吧啊吧
页: 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 [1707] 1708 1709 1710 1711 1712 1713 1714 1715 1716
查看完整版本: S1E2:第一个程序 | 课后测试题及答案