STL解法 vector<pair<int ,int>> 然后再 sort 摘要:解题思路: 前两个数相加即vector元素个数,pair将两个数据组合成一个元素,v.push_back后 sort注意: make_pair()是函数 别写成<>参考代码:/******…… 题解列表 2023年03月09日 0 点赞 0 评论 371 浏览 评分:0.0
c++水仙花数判断 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a = 0; for(int i=100;i<=…… 题解列表 2023年03月09日 0 点赞 0 评论 267 浏览 评分:0.0
连续输入用重复执行解决 摘要:解题思路:模板给的开头和结尾还是很有用的遇到连续输入还好是还是要尽量用一下while true:try:except:break挺好用注意事项:参考代码:while True: try: …… 题解列表 2023年03月09日 0 点赞 0 评论 279 浏览 评分:0.0
递归初体验 摘要:解题思路:感觉很不错的样子,看了朋友的理解好像有点懂,没什么问题吧,问题简化初始化,看看尽头是什么过程又是什么注意事项:参考代码:def fun(n): if n==1: retu…… 题解列表 2023年03月09日 0 点赞 0 评论 367 浏览 评分:0.0
题目 1995: 画三角形-常规求解方法 摘要:解题思路:几次for循环注意事项:注意结束条件EOF,'\'字符的表示为'\\'参考代码:#include<stdio.h> int main(void) { …… 题解列表 2023年03月09日 0 点赞 0 评论 238 浏览 评分:0.0
编写题解 1050: [编程入门]结构体之成绩记录 摘要:```c #include #include #include #include #include typedef struct stu { char num[100]; c…… 题解列表 2023年03月09日 0 点赞 0 评论 503 浏览 评分:0.0
1047: [编程入门]报数问题 摘要:合理利用continue是该题突破的重点 即解决《在报数时如何跳过已经退圈的位置》 ```c #include #include #include #include int mai…… 题解列表 2023年03月09日 0 点赞 0 评论 242 浏览 评分:0.0
编写题解 1085: A+B for Input-Output Practice (I) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b; while(scanf("%d%d",&a,&b)==2){ printf("%d\n…… 题解列表 2023年03月09日 0 点赞 0 评论 316 浏览 评分:0.0
题目 2041: 财富之沙(C语言代码) 摘要:解题思路:贪心算法注意事项:需要把单价从大到小排序,重量也要相应地进行变换参考代码:#include<stdio.h> int main(void) { int n, m,temp,val…… 题解列表 2023年03月09日 0 点赞 0 评论 277 浏览 评分:0.0
分解质因子并保存 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;void isWanshu(int n){ int sum=0,k = 0; …… 题解列表 2023年03月09日 0 点赞 0 评论 285 浏览 评分:0.0