一只小白鱼 发表于 2023-10-16 23:10:31

答案

ccyj 发表于 2023-10-17 08:54:37

天天开心

baobei99 发表于 2023-10-17 10:05:14

已认真独立自主完成鱼老师的作业

天慕小刚 发表于 2023-10-17 10:19:14

查看参考答案

seko 发表于 2023-10-17 14:56:19

0.
1.编程语言
2.编译
3.编译语言是源代码直接被编译为机器代码被cpu执行。解释型语言是先转换为中间代码由解释器翻译才能执行。
4.可以
5.通过解释器的翻译
6.查表
7.亲们趁敌人吃饭时发动共

mu-gend3 发表于 2023-10-17 15:55:32

1

Charsificee 发表于 2023-10-17 16:00:55

1111

徐宏俊俊俊 发表于 2023-10-17 17:31:43

因为他只知道0和1
机器
编译



编译
QINMEN

ylc77 发表于 2023-10-17 19:11:05

1

默邂光 发表于 2023-10-17 19:43:27


tub1te 发表于 2023-10-17 20:01:51

666

翘课看夕阳 发表于 2023-10-17 20:12:49

答案

欲将心事诉于风 发表于 2023-10-17 20:18:27

1

杜曜_略 发表于 2023-10-17 21:44:35


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

纪叶 发表于 2023-10-17 22:41:42

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

#define MAX      256

long total;

int counLines(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;
}

黑猫呀 发表于 2023-10-18 13:43:26

1、因为计算机是0和1组成的。
2、汇编语言。
3、编译。
4、一个是全部写完了,编译器在编译出来给机器执行,一个是边写边解释的。吧?
5、只要两个平台有一样的解释器,就能直接对代码进行跨平台解释。
6、不同的组合代表不同的字母。
7、QINMENCHENDIRENCHIFANSHIFRDONGJINGONG

詩音 发表于 2023-10-18 13:51:32

写完了

23txgclzh 发表于 2023-10-18 15:18:33

请求答案

欢girl 发表于 2023-10-18 16:01:30

我爱firshC

yeel 发表于 2023-10-18 16:23:05

学到了
页: 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 [1966] 1967 1968 1969 1970 1971 1972 1973 1974 1975
查看完整版本: S1E2:第一个程序 | 课后测试题及答案