金币内置for循环 摘要:解题思路:注意事项:参考代码:n = int(input())sum = 0coin_per = 0day = 0q = 0while n > q: day += 1 coin_per +…… 题解列表 2023年11月14日 0 点赞 0 评论 680 浏览 评分:9.9
优质题解 Yu金币简洁易懂写法 ##解析:本题无法直接循环天数和金币数。但是发现一个规律,连续的n天都发放n枚金币。我们可以用while循环解决连续n天发放n枚金币。**我的解法:**sum记录总金币,n代表总天数,day代表当前第几天。for循环里:用i代表该天应当获得的金币数,而day控制循环while循环:连续k天金币加i个。 题解列表 2023年11月10日 0 点赞 0 评论 942 浏览 评分:9.9
简单的数学题 摘要:解题思路:题目可以理解为n天,每天给n块,换算成公式就是x=x+n*n,所以我们可以按公式算出来,然后增加一个判断,是否为1+2+3+4……+n的值,不是就减去。注意事项:参考代码:#include<…… 题解列表 2023年10月23日 0 点赞 0 评论 659 浏览 评分:9.9
题解 2833:只因币 摘要:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int sum=0,a=0 ; int n ; cin>>n…… 题解列表 2023年07月14日 0 点赞 0 评论 599 浏览 评分:9.9
金币C语言版 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,i,sum=0,n,c; scanf("%d",&n); for(i=1,c=1;i<=n;c++)…… 题解列表 2022年11月05日 0 点赞 1 评论 895 浏览 评分:9.9
2833: 金币(先5星再复制) 摘要:解题思路:一天一天for注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int main() { int i,n,a,sum,d…… 题解列表 2023年01月04日 0 点赞 0 评论 581 浏览 评分:9.9
***********金币**************** 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a=0,n,sum=0; cin>>n…… 题解列表 2023年07月14日 0 点赞 0 评论 504 浏览 评分:9.9
2833: 金币 摘要:解题思路:分析题目我们可知,第一天,循环一次,获得一个金币;第二第三天,循环两次,每次两个金币;第四五六天,循环三次,每次三个金币……所以,我们需要一个主循环来控制金币个数,而子循环来控制获得金币的次…… 题解列表 2023年01月07日 0 点赞 0 评论 570 浏览 评分:9.9
国王的金币 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int day,money=0,mmoney=1,i…… 题解列表 2023年07月14日 0 点赞 0 评论 1017 浏览 评分:9.9
教你两秒钟解决 金航 问题(小黑子也会=_=) 摘要:解题思路: 设置一个条件,当符合该条件,金币数加1 =_=||注意事项: 天冷了,多喝热水>_< 参考代码:#include <stdio.h>int main(){ …… 题解列表 2023年01月09日 0 点赞 0 评论 664 浏览 评分:9.9