题解 2833: 金币 (使用数学公式) 摘要:| 天数 | 1 | 2 | 3 | 4| 5 |6 | 7 | 8 | 9 | 10 |...| | :------------ | :------------ | :-…… 题解列表 2024年04月09日 0 点赞 0 评论 317 浏览 评分:9.9
金币超简单 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n, i, j, k = 0, s = 0; scanf("%d", &n); fo…… 题解列表 2022年12月05日 0 点赞 0 评论 443 浏览 评分:9.9
用for嵌套解决国王的烦恼——发工资(C语言) 摘要:简单的for嵌套是无法解决的,我们需要加入一些判断才能解决。#include<stdio.h> #include<stdlib.h> int main(){ int n,coins=0,day=…… 题解列表 2024年11月06日 0 点赞 3 评论 220 浏览 评分:9.9
国王的烦恼——发工资,简单方法 摘要:解题思路:如果为6天,金币数为6-0+(6-0)-(0+1)+[(6-0)-(0+1)]-(0+1+1)=14,可推断出为n天时金币为(n-0)+(n-0)-(0+1)+[(n-0)-(0+1)]-(…… 题解列表 2024年11月06日 0 点赞 0 评论 177 浏览 评分:9.9
感觉还挺难的 摘要:参考代码:import java.util.Scanner; public class Main { public static void main(String[] args) …… 题解列表 2024年01月14日 0 点赞 0 评论 368 浏览 评分:9.9
2833: 金币(简单易懂) 摘要:```c #include #include int main() { int n; int sum = 0; scanf("%d", &n); int num; int …… 题解列表 2023年12月16日 0 点赞 0 评论 211 浏览 评分:9.9
金币获取问题(python易理解写法) 摘要:解题思路:此题由于金币获取的方法,所以不能直接遍历天数和金币,所以要定义一个变量去过渡参考代码:n = int(input())day = 0 #天数sum = 0 #金币数for i i…… 题解列表 2023年12月13日 0 点赞 0 评论 284 浏览 评分:9.9
金币内置for循环 摘要:解题思路:注意事项:参考代码:n = int(input())sum = 0coin_per = 0day = 0q = 0while n > q: day += 1 coin_per +…… 题解列表 2023年11月14日 0 点赞 0 评论 289 浏览 评分:9.9
优质题解 Yu金币简洁易懂写法 摘要: ##解析: 本题无法直接循环天数和金币数。 但是发现一个规律,连续的n天都发放n枚金币。 我们可以用while循环解决连续n天发放n枚金币。 **我的解法:** sum记…… 题解列表 2023年11月10日 0 点赞 0 评论 394 浏览 评分:9.9
简单的数学题 摘要:解题思路:题目可以理解为n天,每天给n块,换算成公式就是x=x+n*n,所以我们可以按公式算出来,然后增加一个判断,是否为1+2+3+4……+n的值,不是就减去。注意事项:参考代码:#include<…… 题解列表 2023年10月23日 0 点赞 0 评论 295 浏览 评分:9.9