illbs 发表于 2017-4-19 21:11:40

看一下

Niocle1919 发表于 2017-4-19 21:32:31

0.因为计算机只能识别二进制
1.CPU唯一认识的语言是汇编语言,还是由1和0组成的指令码?
2.C语言编写的源代码转换为汇编语言的过程叫做编译
3.编译型语言和解释型语言的本质区别是,编译型语言是将源程序先翻译成机器语言,并生成一个目标文件,解释型语言就是先翻译成中间代码,执行的时候再进行解释运行,每运行一次要翻译一次。(查阅了资料,也不知道对不对)
4.不可以。
5.解释型语言通过中间代码,再进行的编译,可以适应不同系统的编译器、
6.莫斯密码的原理是,相当于C语言中的符号常量定义
7.亲们趁敌人吃饭时发动进攻

图片添加不进去...能不能告诉我怎么在MAC的xcode上编程啊...还是直接用终端?

王彤玮 发表于 2017-4-20 15:52:21

11

毛毛毛丶 发表于 2017-4-20 18:44:51

很棒!支持楼主

bcxx 发表于 2017-4-20 23:45:21

{:9_230:}

向一朵朵鲜花 发表于 2017-4-21 07:38:32

fucking.....

yvc220 发表于 2017-4-22 16:20:00

已完成!

wudey3 发表于 2017-4-23 00:55:52

老师这个代码不对啊path没有东西

达伦杨 发表于 2017-4-23 15:55:41

答案是什么

问君能有几多愁 发表于 2017-4-25 12:49:18

最后那个密码没

auto_maniac 发表于 2017-4-25 20:45:56

0:计算机只能靠电路开闭的方式处理或者接收指令,能快速做大量重复性的操作,却不能理解主观性的内容!
1:二进制语言
2:编译
3:编译型语言可以直接将业务代码转化为机器代码,而解释性语言减少了和底层之间的沟通,需要再次翻译成计算机可执行的机器代码,降低了效率
4:可以
5:给每一个平台添加一个翻译器,各平台业务逻辑代码一直,最后根据底层的不同,将其转化为其平台可执行文件
6.提前声明各种操作组合所代表的含义,接收者可以参照莫斯密码表,翻译原话。
7:亲们疤痕敌人出发票是发动进攻

wyan 发表于 2017-4-26 16:32:31

支持

残魂cc 发表于 2017-4-26 22:03:45

二进制    机器语言

欧阳0116 发表于 2017-4-27 08:32:28

查看

毕竟我是小纯洁 发表于 2017-4-27 17:41:48

加油

pda999 发表于 2017-4-27 20:00:04

e:\test\ls2.JPG

tlang2052 发表于 2017-4-27 21:52:56

Qinmenchendirenchifanshifadongjingong

圣一94 发表于 2017-4-27 22:42:26

我是来看答案的

lizhiyong_11 发表于 2017-4-30 16:01:02

我来看答案了

zwy12138 发表于 2017-5-1 09:40:37

为什么我显示"Undefined reference to WinMain@16"
#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 nain()
{
        char path=".";

        printf("Counting...\n");

        findAllCodes(path);
        findALLDirs(path);

        printf("So far you have typed %ld lines of codes!\n\n",total);
        system("pause");

        return 0;
}
页: 54 55 56 57 58 59 60 61 62 63 [64] 65 66 67 68 69 70 71 72 73
查看完整版本: S1E2:第一个程序 | 课后测试题及答案