纪念品分组(贪心思维) 摘要:> 直接排序,让价格从低到高,然后价格高的和低的一起,如果没有超过上限,就一组,cnt++> 如果超过上限,价格高的一组,cnt++```cpp#include using nam…… 题解列表 2025年02月21日 2 点赞 0 评论 223 浏览 评分:0.0
用字符串存储方便反转 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int init(string s){ int x = 0; while…… 题解列表 2025年02月22日 0 点赞 0 评论 364 浏览 评分:0.0
易懂-数组输出 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>intmain(){&nbs…… 题解列表 2025年02月22日 0 点赞 0 评论 184 浏览 评分:0.0
回文判断-for循环 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>intmain(){ chara[1…… 题解列表 2025年02月22日 1 点赞 0 评论 231 浏览 评分:0.0
统计字符个数-总个数为10 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>intmain(){&n…… 题解列表 2025年02月22日 0 点赞 0 评论 239 浏览 评分:0.0
字符逆序-一个for搞定 摘要:解题思路:注意事项:#include<stdio.h>#include<string.h>intmain(){&…… 题解列表 2025年02月18日 0 点赞 0 评论 236 浏览 评分:0.0
数位排序简单写法:sorted函数 摘要:解题思路:int(i)for i in str(num):生成器表达式,用于将数字整体分开,看成其组成部分;1.str(num)用于将数字变为字符串,使其不再具有数字的意义,如123变为”123“。2…… 题解列表 2025年02月22日 4 点赞 0 评论 391 浏览 评分:0.0
递推公式位数问题 摘要:```cpp#include using namespace std;int main() { int n; cin >>n; const i…… 题解列表 2025年02月22日 0 点赞 0 评论 386 浏览 评分:0.0
简单讲讲自己的思路 摘要:def a(n): #当年份小于等于4时,那就只有刚开始的那头母牛在生崽,所以直接输出数量即可 if n <= 4: …… 题解列表 2025年02月22日 4 点赞 0 评论 1030 浏览 评分:6.0
奇数个数-简简单单,一个while循环搞定 摘要:解题思路:注意事项:参考代码:#include<stdio.h>intmain(){ intn,a=0; scanf("%d",…… 题解列表 2025年02月22日 0 点赞 0 评论 185 浏览 评分:0.0