luckzjzhao 发表于 2018-8-24 10:00:36

fishc

Jacobdddddsk 发表于 2018-8-24 16:08:23

GG

齐尘邈 发表于 2018-8-24 19:50:54

程序截图

大鹏家 发表于 2018-8-25 18:56:45

查看

staropenlove 发表于 2018-8-25 19:11:33

看看

playboyfull 发表于 2018-8-25 20:07:52

这个还好

playboyfull 发表于 2018-8-25 20:18:25

怎么只写了七行代码呢?

小卓卓 发表于 2018-8-26 00:58:36

0

费曼 发表于 2018-8-26 02:09:06

{:5_90:}

cyzff 发表于 2018-8-26 10:38:12

1

塞外之云 发表于 2018-8-26 11:25:00

.

YoKeing 发表于 2018-8-26 15:49:05

回复

xl7613 发表于 2018-8-26 20:46:05

看看

城南花异 发表于 2018-8-26 22:07:13

0。只懂得二进制的0和1
1 机器码 2 编译 3解释型语言就是跨平台,但是效率低 编译型语言效率高 4 可以执行 5 转换成字节码,在发送给解释器,再发给cpu执行 6 查表 7 qin men chen di ren chi fan shi fa dong jin gong

仅有的倔强 发表于 2018-8-27 08:42:24

1.因为它只认识 0和 1
2.机器语言
3.编译
4. 编译型语言 进行编译, 就可 使CPU执行
    解释型语言需要转换成字节码,经过解释器 ,才能使CPU 可执行
5.是吧。。
6.使用不同的解释器
7.编码和解码
8

798487012 发表于 2018-8-27 11:38:21

看看

22356566 发表于 2018-8-27 13:54:20

{:10_250:}{:10_250:}

a1242490186 发表于 2018-8-27 16:01:19

来看答案

懒床先生 发表于 2018-8-27 16:48:06

忘记答案了都

西瓜是水里的瓜 发表于 2018-8-27 17:30:16

系统提示第62行错了,然而没看出来哪错了..
#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 _finddate_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 ;
}
页: 153 154 155 156 157 158 159 160 161 162 [163] 164 165 166 167 168 169 170 171 172
查看完整版本: S1E2:第一个程序 | 课后测试题及答案