5201310 发表于 2020-9-19 14:50:26

小甲鱼棒棒棒棒棒棒棒

shanren200 发表于 2020-9-19 15:22:48

感谢分享

aquila 发表于 2020-9-19 15:52:14

感谢作者

728312081 发表于 2020-9-19 16:12:29

fighting!!!

m72719672 发表于 2020-9-19 16:16:50

谢谢小甲鱼

limitbreak 发表于 2020-9-19 16:41:07

0.不知道
1.机器码
2.编译
3.解释型语言需要解释器
4.不知道
5.把源码转换成中代码,然后发送给解释器再翻译给CPU
6.查表
7.亲们趁敌人吃饭时发动进攻

Edison杨 发表于 2020-9-19 17:33:35

0.因为计算机cpu只能识别二进制的0和1;1.机器码;2.编译;3.编译型语言可以通过编译的过程将源代码转换为机器码被机器读懂;而解释型语言不能直接转换为机器码,而是将源代码转换为中间代码,然后发送给解释器,解释器把其翻译使得机器能够读懂;4.能;5.将中间代码发送给解释器;6.解码与编码;qinmen chen di ren chifan shi fa dong jin gong 亲们,趁敌人吃饭时,发动进攻。

19981218liu 发表于 2020-9-19 17:41:01

看看答案是啥

QCY_13 发表于 2020-9-19 18:10:18

2020.9.19

Sherlock_Y 发表于 2020-9-19 18:18:47

阿巴

我叫星星 发表于 2020-9-19 18:30:39

fish fish

LDKS 发表于 2020-9-19 19:11:29

day1

yansi 发表于 2020-9-19 19:47:13

谢谢鱼老师

zhijie 发表于 2020-9-19 20:03:10

感谢楼主

sterben555 发表于 2020-9-19 20:27:29

1,因为它之认识0和1
2,机器语言
3,编译
4,不能,得安装linux虚拟机
5,通过解释器翻译给不同的平台
6,通过点和线的组合代表不同的信息,通过信息的再次组合变成我们所交流的语言
7,

等WAIT 发表于 2020-9-19 20:55:37

答案

zgaosguai 发表于 2020-9-19 21:02:59

带你学C带你飞

zhijie 发表于 2020-9-19 21:13:44

为什么我编辑打开了是204行代码的?

番茄也想变成马 发表于 2020-9-19 21:25:35

不知道怎么进入编程界面啊

zhijie 发表于 2020-9-19 21:26:35

为什么我运行出来时204行代码的{:10_243:}

#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;
}
页: 853 854 855 856 857 858 859 860 861 862 [863] 864 865 866 867 868 869 870 871 872
查看完整版本: S1E2:第一个程序 | 课后测试题及答案