鱼C论坛

 找回密码
 立即注册
楼主: 小甲鱼

[课后作业] S1E2:第一个程序 | 课后测试题及答案

    [复制链接]
发表于 2018-5-10 00:23:37 | 显示全部楼层
0,二进制
1,机器语言
2,编译
3,不直接编译,通过中间语言
4,不行
5,通过中间语言解释
6,解码
7,qinmenchendirenchifanshifadongjingong!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-10 07:45:42 From FishC Mobile | 显示全部楼层
123456789
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-10 09:32:20 | 显示全部楼层
q i n  m e n  c h e n  d i  r e n  c h i  f a n  s h i  f a  d o n g  j i n  g o n g
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-10 16:17:49 From FishC Mobile | 显示全部楼层
想知道
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-10 23:24:04 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-11 05:14:27 | 显示全部楼层
0、计算机之能识别2进制数,也就是1和0

1、CPU唯一认识的语言是机器语言

2、汇编

3、编译语言最后会变成机器认识的机器码,而解释性语言是通过解释器把字节码等翻译成机器码让机器执行

4、不行,需要通过修改

5、让字节码通过解释器以后让cpu执行

6、通过记录不同声音的长短,然后查表还原出对应的字母,再还原成信息

7、亲们趁敌人吃饭时发动进攻

动动手
屏幕快照 2018-05-10 23.13.53.png
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-11 13:22:48 | 显示全部楼层
QQ截图20180511132218.png
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-11 16:46:35 | 显示全部楼层

RE: S1E2:第一个程序 | 课后测试题及答案

楼主,我动动手最后显示id returned 1 exit status  请问怎么回事
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-12 13:59:43 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-12 23:39:53 | 显示全部楼层
已自写
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-13 15:35:48 | 显示全部楼层
我最吊
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-14 09:52:49 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-14 17:19:32 | 显示全部楼层
终于打完了,求答案!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-14 17:33:57 | 显示全部楼层
计算机只能识别0和1
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-14 19:56:43 | 显示全部楼层
棒!!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-15 10:14:22 | 显示全部楼层
看看答案
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-15 14:33:48 | 显示全部楼层
101???
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-16 11:20:13 | 显示全部楼层
回复看答案
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-16 11:38:42 | 显示全部楼层
本帖最后由 爱因斯坦程序员 于 2018-5-19 10:21 编辑

[code]#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX        256

long total;

int countLines(const char *filenmae);
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 fle:%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[MAX], target[MAX];

        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[MAX];

        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[MAX] = ".";

        printf("计算中...、\n");
       
        findAllCodes(path);
        findALLDirs(path);

        printf("目前你总共写了%1行代码!\n\n", total);
       
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-5-16 22:39:07 From FishC Mobile | 显示全部楼层
⊙⊙!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-15 00:30

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表