C语言训练-最大数问题(C++的解法) 摘要:解题思路:这道题目很简单,不需要开数组也不需要其他的内容,只需要两个变量——n与max。 设置一个while(true)的循环,而后每次循环开始都读入一个n,而后对n的数值进行一个判定,如果n==-1…… 题解列表 2024年06月20日 0 点赞 0 评论 772 浏览 评分:9.9
好笨的方法,哈哈哈,编写程序实现“剪刀,石头,布”游戏。 摘要:解题思路:输入,然后通过选择得出结果,最后输出注意事项:在赋值的时候,因为是枚举类型,所以不可以使用cin输入参考代码:#include#include #include typedef enum G…… 题解列表 2024年06月20日 0 点赞 0 评论 769 浏览 评分:9.9
新手来看好玩的插入排序,开眼界咯 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int arr[4];int main(){ for(int i =0;i<4;i++) …… 题解列表 2024年06月19日 0 点赞 0 评论 493 浏览 评分:0.0
麻了 已有a、b两个链表,每个链表中的结点包括学号、成绩。要求把两个链表合并,按学号升序排列。 摘要:解题思路:先创单链表,然后本题考查的就是单链表的增删改查基本操作,最后多了排序,我们先将信息存进去,然后合并,再排序,最后输出;注意事项:一定要抽象清晰,基础扎实参考代码:#include<iostr…… 题解列表 2024年06月18日 0 点赞 0 评论 772 浏览 评分:9.9
Max函数(c++) 摘要:解题思路:使用Max函数int a=0,b=1; int c=max(a,b);//然后c会被max赋值为两个数中更大的数的值注意事项:max中只能填两个数参考代码:#include<bits/st…… 题解列表 2024年06月17日 1 点赞 0 评论 687 浏览 评分:9.9
编写题解 1098: 陶陶摘苹果 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){int a[10],tg,zd=0; for(int i=0;…… 题解列表 2024年06月16日 0 点赞 0 评论 523 浏览 评分:0.0
C语言训练-计算一个整数N的阶乘 摘要:解题思路:循环注意事项:阶乘参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int i,n,sum; sum=1;…… 题解列表 2024年06月16日 0 点赞 0 评论 487 浏览 评分:0.0
2799 奥运奖牌计数 摘要:解题思路: #include <bits/stdc++.h> using namespace std; int main() { int n,sum1=0, sum…… 题解列表 2024年06月16日 0 点赞 0 评论 550 浏览 评分:2.0
N以内累加求和 摘要:解题思路:循环注意事项:n大写参考代码:#include <iostream>using namespace std;int main() { int N,sum = 0; cin >> …… 题解列表 2024年06月16日 0 点赞 0 评论 693 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n,sum=0; cin>>n; …… 题解列表 2024年06月16日 1 点赞 0 评论 997 浏览 评分:9.9