复古风菲菲哥 发表于 2023-12-31 22:59:29

写了0行代码,{:9_230:}

我不是Ikun 发表于 2024-1-1 14:41:48

{:5_104:}

白日空想家 发表于 2024-1-1 20:08:49

111

九晁衣 发表于 2024-1-1 21:24:47

查看参考答案

ricoYang 发表于 2024-1-2 09:06:50

1

mmds 发表于 2024-1-2 13:03:08

查看答案

Ashley-7 发表于 2024-1-2 15:26:20

1

yuanguixiang 发表于 2024-1-2 16:50:20

k

yang4522107 发表于 2024-1-2 17:22:45


1

小贤先生 发表于 2024-1-2 18:21:10

kk

Resonate 发表于 2024-1-2 19:39:20

1

huangchong 发表于 2024-1-2 21:09:58


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

#define MAX      256

长总计;

int countLines(const char *文件名);
无效 findAllCodes(const char *path);
void findALLFiles(常量字符 *路径);

int countLines(常量字符 *文件名)
{
文件 *fp;
int 计数 = 0;
int 温度;
      
if ((fp = fopen(filename, “r”)) == NULL)
      {
fprintf(stderr, “无法打开文件:%s\n”, filename);
返回 0;
      }
      
而 ((temp = fgetc(fp)) != EOF)
      {
如果 (temp == '\n')
                {
计数++;
                }
      }
      
关闭(fp);
      
返回计数;
}

无效 findAllCodes(常量字符 *路径)
{
结构_finddata_t fa;
长柄;
char thePath, target;
      
strcpy(路径,路径);
if((handle = _findfirst(strcat(thePath, “/*.c”), &fa)) != -1L)
      {

                {
sprintf(target, “%s/%s”, 路径, fa.name);
总计 += countLines(target);
}while (_findnext(句柄, &fa) == 0);
      }
   
_findclose(手柄);
}

无效 findALLDirs(常量字符 *路径)
{
结构_finddata_t fa;
长柄;
char thePath[最大];
      
strcpy(路径,路径);
if((handle = _findfirst(strcat(thePath, “/*”), &fa)) == -1L)
      {
fprintf(stderr, “路径 %s 是错误的!\n”,path);
返回;
      }
   

      {      
if (!strcmp(fa.name, “.”) || !strcmp(fa.name, “..”))
继续;
                  
if( fa.attrib == _A_SUBDIR)
                {      
sprintf(thePath, “%s/%s”, 路径, fa.name);
findAllCodes(路径);
findALLDirs(路径);
                }
}while (_findnext(句柄, &fa) == 0);
   
_findclose(手柄);
}

int main()
{
char 路径 = “.”;
      
printf(“计算中...\n”);
      
findAllCodes(路径);
findALLDirs(路径);
      
printf(“目前你总共写了 %ld 行代码!\n\n”, total);
system(“暂停”);
      
返回 0;
}

谢谢小白 发表于 2024-1-3 11:19:37

第一节课学习完成

syz要做大佬 发表于 2024-1-3 14:30:11

0.计算机只认识0和1
1.机器语言(机器码)
2.编译
3.编译性语言源码编译成机器码,CPU执行机器码
解释性语言不直接编译成机器码,而是编译为中间代码,交给解释器去执行
4.不可以,不具有跨平台性
5.靠解释器,不同操作系统上解释器不同,但都可以识别中间代码
6.

syz要做大佬 发表于 2024-1-3 14:32:09

1

yyatesx 发表于 2024-1-3 15:03:33

努力学习

李晨悦 发表于 2024-1-3 16:41:27

1

野蛮娘炮 发表于 2024-1-3 18:27:54

二位率

惑弋 发表于 2024-1-3 19:04:07

我是菜鸡儿 发表于 2024-1-4 10:46:01

1
页: 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 [1991] 1992 1993 1994 1995 1996 1997 1998 1999 2000
查看完整版本: S1E2:第一个程序 | 课后测试题及答案