版权声明:ACM代码随意转载。算法描述需备注来源。谢谢合作。 https://blog.csdn.net/Sensente/article/details/90143462
杭电6510 http://acm.hdu.edu.cn/showproblem.php?pid=6510
题目大意:求圆柱体体积。
注意:中间存在/运算,不能在中间进行,而是统一进行。
PE提示:输出无换行。
AC代码:
#include <iostream>
#include <cstring>
#include <algorithm>
#include <stdlib.h>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
int h,r;
int main() {
while(cin >> h >> r) {
int cost = ((4 * r * r * r) + 3 * (r * r * h));
cout << cost;
}
return 0;
}