错了n次了,让所有的水题汗颜啊!
View Code
#include " iostream " using namespace std; #define pi 3.1415926 // 3.1415927(wrong) int main(){ int n; double a,b,sum; cin >> n; int i = 0 ; while (n -- ) { cin >> a >> b; sum = pi * (a * a + b * b) / 2 ; int x = ( int )(sum / 50 ) + 1 ; // (int)sum/50+1(wrong) cout << " Property " <<++ i << " : " << " This property will begin eroding in year " ; cout << x << " . " << endl; } cout << " END OF OUTPUT. " << endl; return 0 ;}