Azhbdhlxt 发表于 2021-10-23 14:01:04

yyds

后撤步777 发表于 2021-10-23 15:01:56

2021.10.23

噗呲噼呲 发表于 2021-10-23 15:36:49

1

我是猫君 发表于 2021-10-23 15:40:16

1

min0530 发表于 2021-10-23 15:50:37


水院水 发表于 2021-10-23 15:58:13

学习时间到!

gcy1332 发表于 2021-10-23 16:28:25

让我康康

张cl 发表于 2021-10-23 17:02:06

ok

13172875208s 发表于 2021-10-23 18:40:16

参考答案

engine0 发表于 2021-10-23 19:00:54

1

郑小白1104 发表于 2021-10-23 19:22:34

0.二进制
1.低级语言
2.编译
3.c语言和java或其他版本的
4.能
5.不知道
6.编码原理
7.hello world

Uzi!! 发表于 2021-10-23 19:30:28

!!!感谢

与时俱学进 发表于 2021-10-23 20:16:20

查看参考答案

与时俱学进 发表于 2021-10-23 20:29:34

我自己打的,对照了几遍没出错,运行结果是0,复制过去再试了一遍,结果也是0,怎么回事啊{:10_266:}{:10_266:}{:10_266:}

极客YY 发表于 2021-10-23 21:00:28

答案

bobe. 发表于 2021-10-23 23:25:07


#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;
}

202108030421 发表于 2021-10-23 23:25:21

0.它只懂得二进制的0和1,不能直接给它下命令。
1.机器语言。
2.编译。
3.编译型语言将源代码编译成机器语言从而CPU可以直接执行。
4.能。
5.解释型编程语言不直接编译成机器语言,而是将源代码转换成中间代码,然后发送给解释器,由解释器逐句翻译给CPU来执行。
6.查表。
7.秦门城滴人吃饭时发动进攻。

丰系人良君 发表于 2021-10-24 09:45:08

#include<stdio.h>
int main()
{
    printf("Hallowould");
    return 0;
}

755602719 发表于 2021-10-24 09:46:33

yyds

755602719 发表于 2021-10-24 09:47:06

回复
页: 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 [1431] 1432 1433 1434 1435 1436 1437 1438 1439 1440
查看完整版本: S1E2:第一个程序 | 课后测试题及答案