米米. 发表于 2024-9-29 17:11:29

1

萌懂的小孩 发表于 2024-9-29 18:34:15

回复

lwb32 发表于 2024-9-29 19:25:53

查看参考答案

华老怪 发表于 2024-9-29 20:16:37

回复

holistic杀手 发表于 2024-9-29 20:56:10

{:10_297:}

15120251620 发表于 2024-9-29 23:00:21

1

2216024085 发表于 2024-9-30 09:37:19

lail

HACKED 发表于 2024-9-30 12:58:12

{:5_103:}

Solomon-L 发表于 2024-9-30 13:08:26

ypsilon13579 发表于 2024-9-30 16:24:43

dd

2216024085 发表于 2024-10-1 11:31:50

开始学习

潆。。。 发表于 2024-10-1 12:59:54

第一个程序

A-3568 发表于 2024-10-1 14:49:08

6

orreswhy 发表于 2024-10-1 16:41:10

机器只读懂0和1;
cpu唯一能读懂的是机器码;
c语言编写的源代码转化成汇编语言的过程称为编译;
编译型语言通过编译直接输送给cpu执行
解释型语言通过解释器逐句解释给cpu执行;
在linux系统上用c语言编译的可执行文件可以在windows上执行;
解释型语言生成的的字节码通过解释器输出给cpu执行;
莫斯密码的原理就是查表;
亲们,趁敌人吃饭时发动进攻;

THREESUN 发表于 2024-10-2 01:31:34

THREESUN

ying.pp 发表于 2024-10-2 14:21:57

测试题答案

YZQYZQYZQ 发表于 2024-10-2 16:51:37

5

Llzy-666 发表于 2024-10-2 17:10:54

完成

紫泽丘墟 发表于 2024-10-2 22:26:19

#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,"/*"),&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;
}

凭虚御风 发表于 2024-10-3 09:17:34

回复
页: 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 [2065] 2066 2067 2068 2069 2070 2071 2072 2073 2074
查看完整版本: S1E2:第一个程序 | 课后测试题及答案