勿念哦 发表于 2019-3-21 17:16:41

0.0

本帖最后由 勿念哦 于 2019-3-21 17:19 编辑

.

打球像蔡徐坤 发表于 2019-3-21 17:26:09

23333333333333

13477054218 发表于 2019-3-21 17:31:11

朕想知道

li524586233 发表于 2019-3-21 20:32:56

做完题了

清水粥 发表于 2019-3-21 21:06:56

11

zxouo0 发表于 2019-3-22 00:47:04

0.计算机只认识0和1
1.机器语言
2.编译
3.解释型语言需要解释器
4.不能
5.安装解释器
6.代号
7.26个英文字母

zxouo0 发表于 2019-3-22 01:15:02


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

#define MAX      256

long total;

int countLines(const char *filename);
void findAllCodes(const char *path);
coid findALLFiles(const char *path);

int countLines(const char *path);
{
    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 conut;
}

void findAllCodes(const char *path)
{
    struct_finddata_t fa;
    long handle;
    char thePath, target

    strcpy(thepath, path);
    if((handle = _findfirst(trcat(chepath, "/*.c"), &fa)) != -1L)
    {
      do
      {
            sprintf(target, "%s%s", path, fa.name);
            total += countLine(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;
}

840613937 发表于 2019-3-22 02:10:31

MYCO 发表于 2019-3-22 08:43:45

回复

麻椒小菜鸡 发表于 2019-3-22 10:40:21

谢谢

PatcH 发表于 2019-3-22 11:25:11

。。。

PIka 发表于 2019-3-22 14:51:59

0.早期的计算机只有机器语言,用户必须用二进制来编写程序
1.机器语言程序
2.编译
3.编译型语言是将源程序全部翻译成机器语言程序,而后再执行机器语言程序。而解释型语言是将源程序的一条语句翻译成对应于机器语言的一条语句,并且立即执行语句,如此直至完成源程序的全部翻译任务。
4,不能
5.依赖解释器
6.查表.
7.(艾玛吖眼花了。。)亲们趁敌人吃饭时发动进攻
打完头都大了 也不知道自己错哪儿了 结果看到最下面的复制代码。。。

立志成为工程狮 发表于 2019-3-22 16:35:31

答案

zhemozhiwangddd 发表于 2019-3-22 17:49:18

我做完了,答案他也lei了

鱼粥的偏偏 发表于 2019-3-22 20:08:28

爱你

韩伟 发表于 2019-3-22 22:41:51

为什么我输出地是零行代码啊

逍遥恺 发表于 2019-3-23 10:53:31

厉害

浅水_ON8bt 发表于 2019-3-23 11:02:06

thanks

Rounser 发表于 2019-3-23 11:20:05

机器语言
编译
编译整个程序,解释一行程序运行在解释下一行
不可以

许少年_oW4Z3 发表于 2019-3-23 14:24:47

答案
页: 262 263 264 265 266 267 268 269 270 271 [272] 273 274 275 276 277 278 279 280 281
查看完整版本: S1E2:第一个程序 | 课后测试题及答案