C语言训练-排序问题<1>解题思路 摘要:解题思路:注意事项:参考代码:int main(){ int i,j,tem; int arr[4]; for(i=0;i<4;i++){ scanf("%d",&ar…… 题解列表 2021年06月25日 0 点赞 0 评论 316 浏览 评分:0.0
C语言训练-尼科彻斯定理解决方案 摘要:解题思路:arr[i]存放相加元素;由规律可知arr[i]=a*a-a+1+2*i;注意事项:参考代码:int main(){ int a,b,c,i; scanf("%d",&a); …… 题解列表 2021年06月25日 0 点赞 0 评论 197 浏览 评分:0.0
C语言训练-字符串正反连接解决方案 摘要:解题思路: 把a数组正反放到b数组内注意事项: 在b数组结尾处需加上‘\0’参考代码:int main(){ char a[100],b[200]; gets(a); int i…… 题解列表 2021年06月25日 0 点赞 0 评论 216 浏览 评分:0.0
C语言训练-委派任务*解决方案 摘要:解题思路:根据条件: 1)A和B两人中至少去一人; 2)A和D不能一起去; 3)A、E和F三人中要派两人去; 4)B和C都去或都不去; 5)C和D两人中去一个; 6)若D不去,…… 题解列表 2021年06月25日 0 点赞 0 评论 329 浏览 评分:9.9
递推式(斐波那契) 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;const int N = 105;int a[N],f[N];int main(…… 题解列表 2021年06月24日 0 点赞 0 评论 631 浏览 评分:9.9
2030: 树的中序遍历(C语言) 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <stdlib.h> typedef struct node { int data; …… 题解列表 2021年06月23日 0 点赞 0 评论 502 浏览 评分:9.9
2029: 获取树的规模(C语言) 摘要:解题思路: 见代码及注释。注意事项:参考代码:#include <stdio.h> #include <stdlib.h> // 树结点结构体 typedef struct node …… 题解列表 2021年06月23日 0 点赞 0 评论 736 浏览 评分:9.9
简单粗暴,使用冒泡排序,将最后一个数字放在最后,然后排序后输出 摘要:```c #include int main(){ int nums[10]; for(int x=0;x…… 题解列表 2021年06月23日 0 点赞 0 评论 451 浏览 评分:0.0
【C++较复杂版解法】可乐:三个空瓶换一瓶,不够还能借一瓶!(有借有还) 摘要:注意事项:这题目要充分考虑,恰当地利用除法和求余运算符除法运算符 ‘/’ 在这道题中,用于求满瓶数求余运算符 ‘%’ 在这道题中,用于求空瓶数变量的初始化也要放在正确的位置(每次循环都要,不然会累…… 题解列表 2021年06月23日 0 点赞 0 评论 1393 浏览 评分:7.3
自定义函数之数字分离 摘要:解题思路:输入一串字符,逐个输出注意事项:循环语句参考代码:#include<iostream>#include<string>using namespace std;int main(){ s…… 题解列表 2021年06月23日 0 点赞 0 评论 861 浏览 评分:8.4