hanguahanni 发表于 2018-12-13 16:39:40

1、因为计算机只认识0和1.
2、机器语言。
3、转译。
4、能。
5、翻译器。
6、每个字母对应符号,然后符号转文字。
7、亲们,趁敌人吃饭时发动进攻。

wxjing 发表于 2018-12-13 20:21:55

答案

Loser_YiMo 发表于 2018-12-13 23:54:35

看看是不是对的

HUMMER军 发表于 2018-12-14 04:39:47

0:因为只认识0和1
1:汇编
2:翻译
3:编译型语言计算机直接可执行,解释型语言需要先翻译成汇编语言计算机才可以执行
4:

a83460116 发表于 2018-12-14 11:13:00

为什么是0行

1297585013 发表于 2018-12-14 17:18:11

444684186

烟花i 发表于 2018-12-14 17:57:16

你好

@邹贝贝 发表于 2018-12-14 18:06:30

1

微悠凉风 发表于 2018-12-14 21:18:07

加油

散步去看雨 发表于 2018-12-14 21:33:40

看看和我想的一样不

某少年的闲日常 发表于 2018-12-14 22:26:45

阿嵩呀, 发表于 2018-12-14 23:07:38


#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 main()
{
                char path =".";
               
                printf("计算中...\n");
               
                findALLCodes(path);
                findALLDirs(path);
               
                printf("目前你总写了%ld 行代码!\n\n",total);
                system("pause");
               
                return 0;
}

zxq7568 发表于 2018-12-15 10:02:23

课后答案

FFsizhendeshuai 发表于 2018-12-15 12:49:07

storage size of 'fa' isn't known

lautung 发表于 2018-12-15 13:48:55

答案

zouhui1115 发表于 2018-12-15 16:39:10

0 只懂二进制
1 机器码
2 编译
3
4 不可以
5 通过解释器
6 编码和解码
7 亲们趁敌人吃饭时发动进攻

jecson2018 发表于 2018-12-15 18:27:34

31

wwf 发表于 2018-12-15 21:52:19

图片不会发,反正我写完了

小待续 发表于 2018-12-16 13:04:57

JY

密码风云 发表于 2018-12-16 17:08:35

12333333333333333333
页: 209 210 211 212 213 214 215 216 217 218 [219] 220 221 222 223 224 225 226 227 228
查看完整版本: S1E2:第一个程序 | 课后测试题及答案