阿奇啊没错 发表于 2022-2-25 20:07:40

咱就是说10kb上传不了图片啊!!!
dev++中文变乱码解决不了……
vs的话就是有一个地方报错(写入位置时发生访问冲突windows 54行)

ByuN 发表于 2022-2-25 20:21:34

恭喜恭喜!!!!!!!!!!!!

iun007 发表于 2022-2-25 21:16:28

1

lin8655168 发表于 2022-2-25 23:15:23

做完啦,来瞧瞧答案

海棠依旧. 发表于 2022-2-25 23:23:33

我怎么感觉我这个有问题啊

一点都不想早八 发表于 2022-2-25 23:30:43

0.因为它只能识别二进制指令
1.机器语言
2.编译
3.解释型语言是直接执行的源码,解释器解释后的源码直接被CPU执行了
4.可以
5.java对于多种不同的操作系统有不同的JVM
6.摩斯密码的原理是用特殊的符号代表具体的字母
7.亲们,趁敌人吃饭时发起进攻

翎马 发表于 2022-2-25 23:33:29

112

洋民Okay 发表于 2022-2-26 00:02:51

答案

Hzy_Binghongcha 发表于 2022-2-26 10:40:10

1

一斤c 发表于 2022-2-26 12:46:29

动动手

wlsinsin 发表于 2022-2-26 13:51:47

看看答案

我爱钒钒钒钒 发表于 2022-2-26 13:59:13

1

fengziyan 发表于 2022-2-26 14:49:56

{:7_131:}

三尺秋水尘不染 发表于 2022-2-26 15:11:29

动完手发现虽然能运行但一直在刷新没有结果出现(悲)附上代码

#include<io.h>
#include<direct.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.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("目前你总共写了 %1d 行代码!\n\n", total);
      system("pause");

      return 0;
}
我是用VS code 直接走的可能检索不到,也有可能是调试的问题之后再研究研究。

遗忘。 发表于 2022-2-26 17:17:28

{:5_92:}

hsint 发表于 2022-2-26 17:36:09

15927330727 发表于 2022-2-26 18:30:12

{:10_327:}

BlueVenus 发表于 2022-2-26 18:57:41

因为计算机只认识“1”和“0”!

13023372165 发表于 2022-2-26 19:05:29

.

2575164418 发表于 2022-2-26 20:24:10

1
页: 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 [1569] 1570 1571 1572 1573 1574 1575 1576 1577 1578
查看完整版本: S1E2:第一个程序 | 课后测试题及答案