【ZOJ Problem Set - 1049】I Think I Need a Houseboat

题目: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;
}

逼死人的是空格。。

猜你喜欢

转载自blog.csdn.net/qq_43524683/article/details/85493723
今日推荐