1122: C语言训练-亲密数 摘要:解题思路:依次循环3000以内的数;先求A的全部因子之和,并赋值给B,再判断B的全部因子之和是否等于A,且需要判断B>A(实现小的在前);注意事项:需要判断B>A,以实现小的在前;参考代码:#incl…… 题解列表 2022年01月19日 0 点赞 0 评论 462 浏览 评分:0.0
奖学金,运用sort函数对结构体类型排序 摘要:解题思路:结构体类型排序,运用sort函数注意事项:自定义比较方法:bool cmp(struct Student &a, struct Student &b)小于5人,则全部输出参考代码:#incl…… 题解列表 2022年01月19日 0 点赞 0 评论 579 浏览 评分:9.9
指针应用,注意虽然是冒泡,但是指针交换值与数组还是有差别 摘要:#include#include#includetypedef struct stu{ int sno; int grade; }STU,*stu; int main(){ int n…… 题解列表 2022年01月19日 0 点赞 0 评论 234 浏览 评分:0.0
不向自定义数组的大小 摘要:#include<stdio.h> #include<string.h> #include<malloc.h> int main(){ int n,m; int status=s…… 题解列表 2022年01月19日 0 点赞 0 评论 187 浏览 评分:0.0
通过单链表删除,省的数组太大,导致循环多次.莫名其妙的char* 摘要:#include<stdio.h> #include<string.h> #include<malloc.h> typedef struct Node{ int c; s…… 题解列表 2022年01月19日 0 点赞 0 评论 188 浏览 评分:0.0
不如链表好,太多判断, 摘要:#include<stdio.h> #include<string.h> #include<malloc.h> int main(){ int n; int status=sca…… 题解列表 2022年01月19日 0 点赞 0 评论 244 浏览 评分:9.9
1097: 蛇行矩阵(最简洁明了) 摘要:解题思路:看题目找规律注意事项:不用再找其他的了,我的是最简单的参考代码:n=int(input())List=[[0]*n for _ in range(n)]List[0][0]=1k=1for …… 题解列表 2022年01月18日 0 点赞 9 评论 826 浏览 评分:9.9
优质题解 阶乘求和(思路不难,但个别地方新手容易翻车)C语言代码 摘要:####解题思路: `S0 = 0 ; A1 = 1! = 1;` `S1 = S0 + A1 = 1!; A2 = 2! = 2*1! = 2*A1 = 2*1;` `S2 = S1 …… 题解列表 2022年01月18日 1 点赞 38 评论 10135 浏览 评分:9.2
用辗转相除法来求最大公约数与最小公倍数【C语言】 摘要:# 用辗转相除法来求最大公约数与最小公倍数 代码如下: ```c #include int gcd(int m, int n) { int q; while (q = m % n)…… 题解列表 2022年01月18日 0 点赞 0 评论 398 浏览 评分:0.0
编写题解 1042: [编程入门]电报加密 摘要:```c #include #include #include int main() { char a[100] = {'\0'}; int i,m; gets(a); m …… 题解列表 2022年01月18日 0 点赞 0 评论 357 浏览 评分:0.0