四舍五入的技巧
#include <iostream>using namespace std;const double PI = 3.1415926;int main(){ float r; while(cin >> r) { cout << int(4*PI*r*r*r/3 +0.5) << endl; } return 0;}
转载于:https://www.cnblogs.com/ekinzhang/p/4374444.html