【ZOJ Problem Set - 1049】I Think I Need a Houseboat
阿新 • • 發佈:2019-01-06
題目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=49
程式碼:
#include<iostream> #include<iomanip> #define E 3.14 using namespace std; int main() { int N; float X, Y ,Z[100]; cin >> N; if (N >= 1) { for (int i = 1; i <= N; i++) { cin >> X >> Y; Z[i] = (E*X*X + E * Y*Y) / 100; } for (int i = 1; i <= N; i++) { cout << "Property " << i << ":"; cout << " This property will begin eroding in year " << setiosflags(ios::fixed) << setprecision(0) << Z[i] + 0.5 << "." << endl; } cout << "END OF OUTPUT." << endl; } return 0; }
逼死人的是空格。。