当前位置: 首页 > 工具软件 > Sausage > 使用案例 >

杭电6510 Problem K. Harbin Sausage

印宏阔
2023-12-01

杭电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;
}

 

 类似资料: