爱吃胡孝琰的仓鼠 • 2年前
int main() {
//freopen("coin.in", "r", stdin);
//freopen("coin.out", "w", stdout);
int n, a, b, c, d, e, f, g, h = 0, w = 0, x, z;
scanf("%d", &n);
a = n / 20;
b = n % 20;
c = b / 10;
d = b % 10;
f = d / 5;
g = d % 5;
h = a + c + f + g;
if (a != 0) {
w++;
}
if (c != 0) {
w++;
}
if (f != 0) {
w++;
}
if (g != 0) {
w++;
}
printf("%d %d", h, w);
return 0;
}
评论:
请先登录,才能进行评论