2833: 金币 摘要:``` #include using namespace std; int x,sum=0,j=0,m=1; int main(){ cin>>x; for( int i=1;i…… 题解列表 2023年11月20日 0 点赞 0 评论 399 浏览 评分:0.0
金币内置for循环 摘要:解题思路:注意事项:参考代码:n = int(input())sum = 0coin_per = 0day = 0q = 0while n > q: day += 1 coin_per +…… 题解列表 2023年11月14日 0 点赞 0 评论 661 浏览 评分:9.9
优质题解 Yu金币简洁易懂写法 ##解析:本题无法直接循环天数和金币数。但是发现一个规律,连续的n天都发放n枚金币。我们可以用while循环解决连续n天发放n枚金币。**我的解法:**sum记录总金币,n代表总天数,day代表当前第几天。for循环里:用i代表该天应当获得的金币数,而day控制循环while循环:连续k天金币加i个。 题解列表 2023年11月10日 0 点赞 0 评论 915 浏览 评分:9.9
简单的数学题 摘要:解题思路:题目可以理解为n天,每天给n块,换算成公式就是x=x+n*n,所以我们可以按公式算出来,然后增加一个判断,是否为1+2+3+4……+n的值,不是就减去。注意事项:参考代码:#include<…… 题解列表 2023年10月23日 0 点赞 0 评论 633 浏览 评分:9.9
金币(Java,含注释) 摘要:解题思路:注意事项:参考代码:import java.util.*;public class Test { public static void main(String[] args){ …… 题解列表 2023年10月10日 0 点赞 0 评论 576 浏览 评分:6.0
金币(是阅读思考题,开始以天数的for循环来做,不好做,还就那个突然悟到了,用while循环,不好文字说) 摘要:解题思路:设每天获取的金币数为i,题目可以看出获取的金币数也是获取该金币数的天数注意事项:参考代码:#includeint main() { int n; int i=1;//金币数 i…… 题解列表 2023年10月05日 0 点赞 0 评论 433 浏览 评分:0.0
闲来无事的题解1111111 摘要:解题思路:注意事项:参考代码:long long a,b; //长整形(100000000000000000000-(-100000000000000000000))int a,b; //普通整…… 题解列表 2023年07月21日 0 点赞 0 评论 529 浏览 评分:0.0
闲来无事的题解 摘要:解题思路:注意事项:参考代码:long long a,b; //长整形(100000000000000000000-(-100000000000000000000))int a,b; //普通整…… 题解列表 2023年07月21日 0 点赞 0 评论 499 浏览 评分:2.0
题解 2833:只因币 摘要:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int sum=0,a=0 ; int n ; cin>>n…… 题解列表 2023年07月14日 0 点赞 0 评论 587 浏览 评分:9.9
***********金币**************** 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a=0,n,sum=0; cin>>n…… 题解列表 2023年07月14日 0 点赞 0 评论 489 浏览 评分:9.9