2 条题解
-
0240915cjb周思源 (周思源) LV 8 @ 2024-08-15 18:29:39
#include <stdio.h>
int main() {
int n, a, b, ans;
while (scanf("%d", &n) == 1) {
a = n;
b = n;
ans = n;
while (a >= 3 || b >= 4) {
n = a / 3 + b / 4;
a = a % 3 + n;
b = b % 4 + n;
ans += n;
}
printf("%d\n", ans);
}
return 0;
} -
-32021-10-29 15:57:55@
#include <stdio.h>
int main() {
int n, a, b, ans;
while (scanf("%d", &n) == 1) {
a = n;
b = n;
ans = n;
while (a >= 3 || b >= 4) {
n = a / 3 + b / 4;
a = a % 3 + n;
b = b % 4 + n;
ans += n;
}
printf("%d\n", ans);
}
return 0;
}
- 1
信息
- ID
- 1040
- 难度
- 4
- 分类
- (无)
- 标签
- 递交数
- 146
- 已通过
- 62
- 通过率
- 42%
- 上传者