llan23 发表于 2021-11-3 11:32:53

莫斯密码的原理其实是什么

HeT. 发表于 2021-11-3 12:26:51

1

Cavanon 发表于 2021-11-3 13:28:23

答案

Suzuaneki 发表于 2021-11-3 14:13:51

233

cs12121 发表于 2021-11-3 14:53:28

伊迪卡拉 发表于 2021-11-3 15:18:28

此帖仅作者可见

rm-rf 发表于 2021-11-3 15:56:44

fh

Achenofficial 发表于 2021-11-3 16:05:13

dd

比特币十万刀 发表于 2021-11-3 16:50:13

fight

FLASHxq 发表于 2021-11-3 17:40:08

答案

炒豌豆 发表于 2021-11-3 18:10:08

{:5_91:}

叶晗小哥哥 发表于 2021-11-3 18:17:25


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

momoka` 发表于 2021-11-3 18:24:06

世界和我们 发表于 2021-11-3 18:32:40

{:5_90:}

五里一徘徊 发表于 2021-11-3 18:34:47

为啥VS2017做出来的打了0行代码

hunshixiaoyue 发表于 2021-11-3 19:10:04

0,
计算机是靠二进制来运行的。

1、
机器语言,也就是二进制

2
编译

3
他们最本质的区别就是编译型语言可以被cpu直接执行,而解释型语言需要被解释器解释以后才能被cpu执行

4
可以

5
将源代码转换成中间代码实现跨平台

7
Q I N M E E
C H E N D
IRE N C
H I F A N
S H I F
A D O N G
J I N G O
N G

珍惜才配拥有 发表于 2021-11-3 19:36:35

1

RickyRi 发表于 2021-11-3 20:44:05

小甲鱼我爱你♥

saysaysay 发表于 2021-11-3 20:49:10

1

泥小梨 发表于 2021-11-3 21:31:47

答案!
页: 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 [1445] 1446 1447 1448 1449 1450 1451 1452 1453 1454
查看完整版本: S1E2:第一个程序 | 课后测试题及答案