PPPeterZhou 发表于 2019-6-22 17:29:16

回复

静音吧 发表于 2019-6-22 18:23:21

6666666666

653212651 发表于 2019-6-22 18:54:15

我想了解

APTX-4869 发表于 2019-6-22 19:18:06

感谢小甲鱼

zw1996922112 发表于 2019-6-22 20:45:07

哈哈

1286920599 发表于 2019-6-22 22:15:17

hi

wjw78879 发表于 2019-6-22 22:16:06

对答案time

飘落丿瑞雪 发表于 2019-6-23 11:46:40


#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 weong!\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;
}

scorpion3.4 发表于 2019-6-23 12:57:40

做完了

whiteeat 发表于 2019-6-23 13:01:47

看答案

萌虫殿下 发表于 2019-6-23 13:49:29

机器语言

Orz~ 发表于 2019-6-23 14:07:24

ss

xxmugua 发表于 2019-6-23 15:00:35

哈哈哈哈,终于打完了,运行成功~

sssagwb 发表于 2019-6-23 16:14:03

答案

muyanl 发表于 2019-6-23 16:57:44

0,因为计算机只会读二进制数
1机器语言
2编译
3
4可以
5
6
7

我爱魔幻 发表于 2019-6-23 17:20:23

0.计算机只认识二进制编码。
1.机器语言。
2.编译过程。
3.编译型语言可以被机器直接识别,解释型语言需要有翻译的过程。
4.可以。
5.通过不同的解释器翻译字节码来进行跨平台
6.编码解码
7.亲们,趁敌人吃饭发动进攻

yjcoke 发表于 2019-6-23 21:28:30

QINMEN CHEND IRENC HIFAN SHIF ANEONG JINGO NG

MarieLi 发表于 2019-6-24 09:47:00

0.计算机只能读懂机器码,也就是只能读懂0和1的二进制串。
1.汇编语言
2.编译
3.编译型语言将高级语言编程机器码,CPU可以直接执行;而解释型语言需要一边解释高级语言的语句,一边执行解释过的语句,循环这个动作,直到所以的代码执行完成。
4.如果没有用到系统的调用应该是可以的,否则就不可以了。
5.解释型语言首先需要转化为机器码才可以实现跨平台。
6.摩斯密码是由点和划线组成。根据点和下划线组成的密码,找到密码本中对应的数字;来破解信息。

hmh123456 发表于 2019-6-24 16:05:32

kkkk


qfj6274364 发表于 2019-6-24 16:06:48

打卡
页: 308 309 310 311 312 313 314 315 316 317 [318] 319 320 321 322 323 324 325 326 327
查看完整版本: S1E2:第一个程序 | 课后测试题及答案