HAC黄轩 发表于 2019-1-5 10:14:05

answer

zcwinner 发表于 2019-1-5 10:48:38

答案

TCY 发表于 2019-1-5 12:31:23

0.只认识0和1
1.机器语言
2.编译
3.编译过程
4.不能
5.……
6.转换成0和1
7.……

dqcgp 发表于 2019-1-5 13:17:21

.

旅行路人大铭ρ 发表于 2019-1-5 14:04:14

总共写了102行代码

studentme 发表于 2019-1-5 14:30:53

已完成

sophisticated 发表于 2019-1-5 16:55:56

{:5_109:}

nasubiofarc 发表于 2019-1-5 17:00:29

https://imgchr.com/i/F7lGHP

Lucas_Liu 发表于 2019-1-5 17:47:40

0:只能识别二进制语言
1:二进制语言
2:编译
3:解释性语言多需要一个解码器
4:可以
5:
6:有一个对应转换表
7:233333

LuLD 发表于 2019-1-5 18:41:07

C:\Users\LuLD\Desktop\无标题.png

谢华泽 发表于 2019-1-6 00:12:48

0.二进制
1.机器码
2.编译
3.炒菜和打火锅
4.好想是要编译器才行
5.编译器
6.点和横的组合来代表字母
7.qinmenchen6renchifa6hifad9gjfg9g(不懂什么意思还望解答   {:10_266:})

dgh1007 发表于 2019-1-6 00:55:50

回复回复

ytzsuying 发表于 2019-1-6 00:56:00

感谢甲鱼教我用c

llugg 发表于 2019-1-6 08:54:51

{:5_90:}

llugg 发表于 2019-1-6 09:19:14

fishc,

aaa4d56 发表于 2019-1-6 10:58:58

.......

年少听风 发表于 2019-1-6 15:10:38

不懂啥叫长柄。。。

木林谷 发表于 2019-1-6 20:42:10

编译后显示错误,打错的都弄了,这个不知道什么问题

qrsin 发表于 2019-1-6 20:43:52

本帖最后由 qrsin 于 2019-1-6 21:00 编辑

为什么我照抄的只有0行代码?复制的也是0行代码?


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

木林谷 发表于 2019-1-6 20:53:05

http://m.qpic.cn/psb?/d397322c-eec9-44ae-9b57-8f833a9fa25c/kfPyUBeOOE7Y*ZOOHM99RycYLYY1CFSS5ojqubozdjI!/b/dDYBAAAAAAAA&bo=WwNbAwAAAAADFzI!&rf=viewer_4
这样子
页: 217 218 219 220 221 222 223 224 225 226 [227] 228 229 230 231 232 233 234 235 236
查看完整版本: S1E2:第一个程序 | 课后测试题及答案