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
这样子

a280887763 发表于 2019-1-6 22:04:46

加油!

木林谷 发表于 2019-1-6 23:31:28

终于把课后作业弄完了,41行    void findAllCodes(const char *path)    两个L打成大写的一直运行不了 复制贴里的可以运行,然后自己10行 10行的替换过去,找到了原因,哈哈哈

韩懿 发表于 2019-1-7 14:24:39

我想看答案

FENGJWEI 发表于 2019-1-7 14:38:57

I love FishC.com!

新锅 发表于 2019-1-7 15:33:03

{:5_108:}

Tenderness15480 发表于 2019-1-7 15:42:05

今天的作业完成

DL1 发表于 2019-1-7 16:40:40

dl
页: 218 219 220 221 222 223 224 225 226 227 [228] 229 230 231 232 233 234 235 236 237
查看完整版本: S1E2:第一个程序 | 课后测试题及答案