探索君 发表于 2022-3-9 19:54:53

1

kobebeef 发表于 2022-3-9 20:26:26

璁$畻涓?..
运行乱码

spring、煌 发表于 2022-3-9 20:34:27

查看参考答案

木炎炎 发表于 2022-3-9 21:05:47

1909382

dianekk 发表于 2022-3-9 21:07:57

做完啦

ldoudou00 发表于 2022-3-9 21:59:07

加油

乔风飞 发表于 2022-3-9 22:32:51

{:10_327:}

liangsiyin 发表于 2022-3-9 22:41:00

day1

蹩脚的码农 发表于 2022-3-10 00:14:27

第三行代码错误?

uuuxyh 发表于 2022-3-10 10:13:31

1111

wzw1029 发表于 2022-3-10 10:45:48

1

xytfan 发表于 2022-3-10 11:16:23

0:只能识别0和1
1:机器语言
2:编译
3:编译型语言能编译为机器语言,而解释型语言不直接编译成机器码
4:可以
5:通过字节码
6:相当于指令
7:qingmenchendirenchifanshifadongjingo

178919 发表于 2022-3-10 12:49:46

学习一下

低调炫技 发表于 2022-3-10 13:34:17

1

小陶要努力 发表于 2022-3-10 13:34:29

1

112233445q 发表于 2022-3-10 14:35:08

朕想看看

404267124 发表于 2022-3-10 14:55:24

1

不忘初心8 发表于 2022-3-10 15:09:28

刚开始学,看的一脸懵逼的

浩哥要学C语言 发表于 2022-3-10 15:28:38


#include <io.h>
#include <直接>
#include <stdio.h>
#include <stdlib.h>
#include <字符串>

#define 最大 256

长总计;

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

int countLines (const char *filename)
{
文件 *fp;
整数计数 = 0;
int temp;

if( (fp = fopen (filename,"r") )== NULL
         {
fprintf(stderr, "无法打开文件: %s\n",文件名) ;
返回 0;
               }
               
while((temp = fgetc (fp) )! = EOF)
         {
if(temp == '\n' )
               {
计数++;
                                  }
               }
               
fclose(fp) ;

返回计数;
}

void findAllCodes (const char *path)
{
结构_finddata_t法;
长柄;
char thePath,target;

strcpy (thePath,path) ;
if (handle = _findfirst (strcat (thePath, "/*.c") , &fa) )! = -1L
         {

                {
sprintf (target,"%s/%s",path,fa.name) ;
总计 += 计数线 (目标) ;
}while (_findnext (handle,&fa) == 0) ;
               }

_findclose (手柄) ;
}

void findALLDirs (const char *path)
{
结构_finddata_t法;
长柄;
char thePath;

strcpy (thePath,path) ;
if ( (handle = _findfirst (strcat (thepath,"/*") ,%fa) ) == -1L)
      {
fprintf (stderr,"The path %s is error! \n", path) ;
返回;
                  }
                  
做                  
          {
if(! strcmp (fa.name,".")|| ! strcmp (fa.name, "..") )
继续;

if ( fa.attrib == _A_SUBDIR)
                {
sprintf (thePath,"%s/%s",path,fa.name) ;
findAllCodes (thePath) ;
findALLDirs (thePath) ;
               }
}while(_findnext (handle,&fa)== 0) ;

_findclose (手柄) ;
}

int main ()
{
char path = ".";

printf ("计算中...\n") ;

findAllCodes (path) ;
findALLDirs (path) ;

printf ("目前你总共写了 %1d 行代码! \n\n",total);
系统 ("暂停") ;

返回 0;
}

1844034822 发表于 2022-3-10 15:55:48

up牛牛牛
页: 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 [1584] 1585 1586 1587 1588 1589 1590 1591 1592 1593
查看完整版本: S1E2:第一个程序 | 课后测试题及答案