困了也不睡 发表于 2024-9-25 17:19:45

未声明,(首次)在函数中的运用。
这个错误怎么改

djxsnd 发表于 2024-9-25 17:44:15

答案

有两种1219 发表于 2024-9-25 20:16:56

真nb吧

JINSHEN 发表于 2024-9-25 21:54:21

风暴之主 发表于 2024-9-25 22:07:38

0.因为只能按照程序进行
1.机器语言
2.编译
3.编译的时机
4.可
5.忘了
6.进制转换
7.

百无禁忌... 发表于 2024-9-25 22:16:23

查看答案

慰问 发表于 2024-9-26 09:00:29

e1

zzzzhty 发表于 2024-9-26 18:16:38

111

liubin1 发表于 2024-9-26 20:52:44

1

LBC04 发表于 2024-9-26 21:17:10

{:5_102:}

离沫来了 发表于 2024-9-26 22:59:41

zzqtop 发表于 2024-9-27 08:48:58

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

#define MAX                256

long total;

int countlines(const char*filename);
void findAllCodes(const char*path);
void finALLFiles(const char*path);

int coutLines(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 wrong1\n",path);
                return;
        }
       
        do
        {
                if ( fa.attrib==_A_SUBDIR)
                {
                        sprintf(thePath,"%s/%s",path,fa.name);
                        findALLDirs(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;
}

吴银辉 发表于 2024-9-27 10:00:10

11

weshsu 发表于 2024-9-27 10:06:20

1

吴银辉 发表于 2024-9-27 10:38:57

1

爱11 发表于 2024-9-27 11:21:28

11

18574173397 发表于 2024-9-27 12:37:30

急急急

洲洲ye 发表于 2024-9-27 13:07:42

{:5_90:}

kangyujie123_ 发表于 2024-9-27 13:50:03

答案

Hikoo 发表于 2024-9-27 13:57:13

完成啦
页: 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 [2063] 2064 2065 2066 2067 2068 2069 2070 2071 2072
查看完整版本: S1E2:第一个程序 | 课后测试题及答案