晴栀竹音 发表于 2020-8-5 16:22:50

小甲鱼老师我用的是visual studio 2019 ,然后输入完Windows的这一串代码后提升我说要在几个函数中加上_s,加了以后又提升函数中调用的参数太少该怎么办{:10_266:}{:10_266:}

spiral 发表于 2020-8-5 16:36:54

{:10_333:}

旭恩 发表于 2020-8-5 17:18:31

参与学习

噗噗噗酱 发表于 2020-8-5 17:34:58

oo

steven.z 发表于 2020-8-5 18:25:00

计算机只认识0和1

老韩哈哈 发表于 2020-8-5 18:43:48

{:10_277:}

y2433159195 发表于 2020-8-5 20:54:22

加油

3515251764 发表于 2020-8-5 20:55:59

起夜趁敌人吃饭时发动进攻

HildaPines 发表于 2020-8-5 21:00:55

哈哈

luoli0791 发表于 2020-8-5 22:26:18

0.计算机只认识2进制
1.c
2.编译
3.前者一次过程完成编译
后者需要2次过程
4.能
5.通过框架
6.与密码本对照实现翻译

Mr`羽殇 发表于 2020-8-5 23:11:28

Mr`羽殇 发表于 2020-8-4 22:03
查看

您好,我检查了很多次和所给的代码是一样的

取什么名字好… 发表于 2020-8-6 09:36:33

只认识二进制

iwes 发表于 2020-8-6 10:08:01

#include <io.h>
#include <dirct.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 conuntLines(const char *filename)
{
         FILE *fp;
               int count= 0;
               int temp;
               
               if((fp = fopen(filename,"r"))== NULL)
               {
                         fprintf(stdeer, "Can not open the file; %s\n", filename);
                         return o;
               }
               
               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
                                {
                                        sprinf(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(theaPath);
                                            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-6 11:57:10

第一次作业也太硬核了吧

xrlzlwf 发表于 2020-8-6 12:10:23

对对答案

yw1490324273 发表于 2020-8-6 14:13:41

w

鲨泥棒 发表于 2020-8-6 15:10:52

学到了

chosen777 发表于 2020-8-6 15:26:58

0.只认识0与1
1.机器语言
2.翻译
3.解释型语言需要通过解释器
4.否
5.
6.读表
7.亲们,趁敌人吃饭时发起进攻

caiwei0328 发表于 2020-8-6 15:45:48

答案

chuxiaomo 发表于 2020-8-6 15:51:08

0.它只懂得二进制的0和1
1.机器语言
2.编译
3.解释型语言不直接编译成机器语言,而是将源代码转换成中间代码,然后发送给解释器,由解释器逐句翻译给CPU来执行
4.能
5.解释型语言不直接编译成机器语言,而是将源代码转换成中间代码,然后发送给解释器,由解释器逐句翻译给CPU来执行
6.一张莫尔斯编码表
页: 791 792 793 794 795 796 797 798 799 800 [801] 802 803 804 805 806 807 808 809 810
查看完整版本: S1E2:第一个程序 | 课后测试题及答案