wuli菜菜 发表于 2020-5-30 01:22:24

1

遇见lucky 发表于 2020-5-30 08:48:01

太棒了

abc1239655273 发表于 2020-5-30 10:28:05

我能问问 为什么我显示你写了0行代码?

青春毁于右手 发表于 2020-5-30 11:31:41

0:因为只能识别机器语言。1:机器语言。2:编译过程。3:编译的代码能否直接被cpu识别。4:有的可以,有的不可以。5:需要一个转换器。6,,7,,,

楠少最逍遥 发表于 2020-5-30 11:34:45

0、因为计算机只认识二进制数
1、机器语言
2、编译
3、C语言是直接编译成机器语言,而Java,Python等都是先由编译器编译成字节码再由解释器解释成为机器码
4、能
5、解释型编程语言由于字节码机器不能识别,因此用解释器来编译成机器语言,在中间码(字节码)阶段可以跨平台
6、和计算机二进制有些像。用点和横来代表电码。然后用不同的点和横的组合来代表字母或者数字。连起来便成了单词或者拼音等语言。
7、趁敌人吃饭时,发动进攻。

阿番 发表于 2020-5-30 13:28:51

查看参考答案

2455809995 发表于 2020-5-30 15:55:00

偷看一下答案

觉迟er 发表于 2020-5-30 16:29:45

{:10_249:}

小德哥 发表于 2020-5-30 17:10:13

老是出错啊{:5_90:}

844370203 发表于 2020-5-30 18:21:21

43        10        C:\Users\Administrator\Desktop\Fishc\s1\×Ô′òí3¼Æ.c        unknown type name 'struck'

djlucifer 发表于 2020-5-30 18:49:15

kandaan

djlucifer 发表于 2020-5-30 19:09:50

小甲鱼老师:
    如附件所示,Xcode打的代码和复制的代码都在如图所示那一行报错,不知道为什么,有空看一下,谢谢。

风吹来了 发表于 2020-5-30 19:14:11

{:10_243:}

Crookie 发表于 2020-5-30 20:48:54

hh

种粮 发表于 2020-5-30 21:30:22

来看答案

好想养猫 发表于 2020-5-30 21:49:17

答案

844370203 发表于 2020-5-30 21:54:41

老师,出现下面两个问题是什么意思?
C:\Users\ADMINI~1\AppData\Local\Temp\cc6hXK2f.o        ×Ô′òí3¼Æ.c:(.text+0x372): undefined reference to `printh'
C:\Users\Administrator\Desktop\Fishc\s1\collect2.exe        ld returned 1 exit status

Twilight. 发表于 2020-5-30 23:45:07


#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX 256

long total;

int countLine(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("目前你总共写了%1d行代码!\n\n",total);
        system("pause");
       
        return 0;
}

Mr.梦魇 发表于 2020-5-31 00:14:54

1

远雨流长 发表于 2020-5-31 06:27:58

谢谢大佬
页: 712 713 714 715 716 717 718 719 720 721 [722] 723 724 725 726 727 728 729 730 731
查看完整版本: S1E2:第一个程序 | 课后测试题及答案