舞步下的泡沫 发表于 2023-8-24 13:09:41

1

sk-II 发表于 2023-8-24 13:33:39

十个小时没搞明白

小菜鸟呀呀 发表于 2023-8-24 15:53:52

查看参考答案

万物不及清瞳 发表于 2023-8-24 18:08:04

只认二进制的0和1
机器语言
编译
前者整体编译,效率高    后者分步解释,效率相对低
80%可
字节码交给解释器解释给cpu执行
符号替代文字
亲们,趁敌人吃饭时发动进攻

把c高高举起 发表于 2023-8-24 23:10:50

{:10_254:}

oumagod 发表于 2023-8-25 01:12:27

鱼C有你更精彩^_^

把c高高举起 发表于 2023-8-25 01:14:45

#include<io.h>
#include<direct.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#define MAX 256
long total;
int countLines(const char *filename);
void fineAllCodes(const char *path);
void fineAllFiles(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,"/*.c"),&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);
                return 0;
      }
运行出来是0

Tw1stz2 发表于 2023-8-25 08:18:21

6666666666666

伊人化浓妆 发表于 2023-8-25 12:04:56

1

OnlyUXF 发表于 2023-8-25 23:47:25

爱你爱你鱼鱼

李印豪 发表于 2023-8-26 17:29:03

1

星星捏 发表于 2023-8-26 21:28:35

.

fzw895378850 发表于 2023-8-26 23:26:26

102行

HUAIJIN_CHEN 发表于 2023-8-26 23:56:35

COOL!

gaoxx 发表于 2023-8-27 10:56:17

{:5_102:}

qcxsg 发表于 2023-8-27 14:56:56

11111

balexay 发表于 2023-8-27 20:11:07


芜湖666 发表于 2023-8-27 20:14:01

sedfsd

18329879564 发表于 2023-8-27 23:33:34

1

shuoboke 发表于 2023-8-28 01:37:23

你好
页: 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 [1934] 1935 1936 1937 1938 1939 1940 1941 1942 1943
查看完整版本: S1E2:第一个程序 | 课后测试题及答案