有点绕
2026-10-09 16:13:58
发布于:广东
1阅读
0回复
0点赞
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
int g0 = floor(n * 0.1);
int s0 = floor(n * 0.2);
int c0 = floor(n * 0.3);
int g1 = ceil(n * 0.1);
int s1 = ceil(n * 0.2);
int c1 = ceil(n * 0.3);
int gold_end0 = g0;
int silver_end0 = g0 + s0;
int copper_end0 = g0 + s0 + c0;
int gold_end1 = g1;
int silver_end1 = g1 + s1;
int copper_end1 = g1 + s1 + c1;
int a = gold_end1 - gold_end0;
int b = silver_end1 - silver_end0;
int c = copper_end1 - copper_end0;
cout << a << " " << b << " " << c << endl;
return 0;
}
这里空空如也

有帮助,赞一个