题解 2833: 金币 摘要:解题思路:首先要找到本题的规律, 我们把这些天数分成几个阶段用k表示,由于不知道要循环多少次,所以只要天数还是大于0的就一直循环下去,用while循环。接下来就要找到每个阶段的规律,第一阶段一枚金币持…… 题解列表 2025年12月09日 1 点赞 0 评论 105 浏览 评分:10.0
金币666简单算法 摘要:#include<stdio.h> int main(){ int i=1,d=0,n,s=0,c; scanf("%d",&n); while(d<n){ c=i; whi…… 题解列表 2024年11月06日 0 点赞 0 评论 295 浏览 评分:0.0
用for嵌套解决国王的烦恼——发工资(C语言) 摘要:简单的for嵌套是无法解决的,我们需要加入一些判断才能解决。#include<stdio.h> #include<stdlib.h> int main(){ int n,coins=0,day=…… 题解列表 2024年11月06日 0 点赞 3 评论 378 浏览 评分:9.9
题解 2833: 金币 (使用数学公式) 摘要:| 天数 | 1 | 2 | 3 | 4| 5 |6 | 7 | 8 | 9 | 10 |...| | :------------ | :------------ | :-…… 题解列表 2024年04月09日 0 点赞 0 评论 469 浏览 评分:9.9
2833: 金币(简单易懂) 摘要:```c #include #include int main() { int n; int sum = 0; scanf("%d", &n); int num; int …… 题解列表 2023年12月16日 0 点赞 0 评论 331 浏览 评分:9.9
简单的数学题 摘要:解题思路:题目可以理解为n天,每天给n块,换算成公式就是x=x+n*n,所以我们可以按公式算出来,然后增加一个判断,是否为1+2+3+4……+n的值,不是就减去。注意事项:参考代码:#include<…… 题解列表 2023年10月23日 0 点赞 0 评论 425 浏览 评分:9.9
金币(是阅读思考题,开始以天数的for循环来做,不好做,还就那个突然悟到了,用while循环,不好文字说) 摘要:解题思路:设每天获取的金币数为i,题目可以看出获取的金币数也是获取该金币数的天数注意事项:参考代码:#includeint main() { int n; int i=1;//金币数 i…… 题解列表 2023年10月05日 0 点赞 0 评论 225 浏览 评分:0.0
国王的金币 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int day,money=0,mmoney=1,i…… 题解列表 2023年07月14日 0 点赞 0 评论 763 浏览 评分:9.9
c语言代码解决问题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n, sum = 0, day_earn = 1,i; scanf("%d", &n); …… 题解列表 2023年06月04日 0 点赞 0 评论 261 浏览 评分:0.0