# 官方题解|欢乐赛47题解 T4
2025-05-14 10:15:36
发布于:浙江
25阅读
0回复
0点赞
T4
题意分析
本题只要用 向上取整函数模拟出这个式子即可。可以采用函数的思想,把相同的一些步骤封装起来,具体见代码。
代码
#include <bits/stdc++.h>
using namespace std;
int get(int a, int b, int c, int d){
return ceil((a + b + c) / d);
}
int main(){
int x, y, z;
cin >> x >> y >> z;
cout << get(get(x, y, z, 3), get(3 * x, 5 * y, 7 * z, 4), get(11 * x, 13 * y, 17 * z, 5), 7);
}
这里空空如也
有帮助,赞一个