3 条题解
-
1韩梓欣 LV 4 @ 2024-12-02 20:46:28
#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;
} -
02024-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
- 分类
- (无)
- 标签
- 递交数
- 148
- 已通过
- 63
- 通过率
- 43%
- 上传者