15812505191 发表于 2022-12-30 15:48:25

ak

chloe_night 发表于 2022-12-30 16:09:24

打卡

yeyou_ 发表于 2022-12-30 16:36:20

1

Pineapple_Li 发表于 2022-12-30 17:22:02

s1e2

0Gungnir0 发表于 2022-12-30 17:58:11

那个代码用vs不能运行吗?

fclearnner 发表于 2022-12-30 19:37:15

test

homeskating 发表于 2022-12-30 21:59:30

查看答案

肖帅 发表于 2022-12-31 10:10:19

1

小王一直在学习 发表于 2022-12-31 11:23:29

答案

AIQ 发表于 2022-12-31 11:42:59

{:10_304:}

dehaoli 发表于 2022-12-31 13:28:21

{:5_103:}

992912868 发表于 2022-12-31 15:23:13

dd

胡汉三01 发表于 2022-12-31 15:24:42

{:5_104:}

取名好麻烦 发表于 2022-12-31 16:23:42

{:5_90:}

进击的小白1124 发表于 2022-12-31 18:02:33

答案

2124881559 发表于 2022-12-31 19:13:20

加油

是瑞瑞瑞 发表于 2023-1-1 10:06:49

查看答案

Key_Dr.C 发表于 2023-1-1 12:04:35

在win11上运行不了呢

CY_Skywalker 发表于 2023-1-1 16:57:02

目前你总共写了 0 行代码!

蔚然的成风 发表于 2023-1-1 16:59:23

0.
计算机只能识别0和1
1.
机器语言
2.
编译
3.
编译型语言计算机可以直接读取
解释型语言计算机不能直接读取,需要通过转化为中间类型来让计算机读取
4.
可以
5.
通过转化为中间都能读懂的语言,然后到对应的计算机上时再进行读取
6.
通过将我们读的懂的语言编译为摩斯密码,来防止泄漏
7.
亲们趁敌人吃饭是发动进攻
动动手:

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

#define 最大 256

长总计;

int countLines(const char *filename);
void findAllcodes(const char *path);
void findALLFiles(const char *path);

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

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

返回计数;
}

void findAllCodes(const char *path)
{
结构_finddata_t FA;
长手柄;
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 FA;
长手柄;
char thePath;

strcpy(thePath, path);
if (handle = _findfirst(strcat(thePath, "/*", &fa)) ==-1L)
        {
fprintf(stderr, "the path %s is wrong!\n", path);
返回;
        }
       

        {
if (!strcmp(fa.name, ".") || !strcmp(fa.name, ".."))
继续;

if(fa.attrib == _A_SUBDIR)
                {
sprintf(thePath, "%s%s", path, fa.name);
查找所有代码(路径);
findAllDirs(thePath);
                }
}while (_findnext(handle, &fa) == 0);

_findclose(手柄);
}

int main()
{
        字符路径 = ".";

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

查找所有代码(路径);
findALLDirs(path);

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

返回 0;
页: 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 [1823] 1824 1825 1826 1827 1828 1829 1830 1831 1832
查看完整版本: S1E2:第一个程序 | 课后测试题及答案