码迷,mamicode.com
首页 > 其他好文 > 详细

1005 i think i need a houseboat

时间:2019-09-11 09:51:42      阅读:65      评论:0      收藏:0      [点我收藏+]

标签:style   std   col   prope   pac   cout   name   put   成功   

在测评系统好几次没有输出成功的原因是printf()中少了空格。

#include<iostream>
#include<cstdio>
#include<cmath>
const double pi=3.1415926;
using namespace std;
int main(){
    double x,y;
    int T;
    int t,h=1;
    cin>>T;
    while(h<=T){
        t=1;
        cin>>x>>y;
        double s=pi*(x*x+y*y)/2;
        t+=(int)(s/50);
        printf("Property %d:",h);
        printf(" This property will begin eroding in year %d.\n",t);
        h++;
    }
    cout<<"END OF OUTPUT."<<endl;
    return 0;
}

 

1005 i think i need a houseboat

标签:style   std   col   prope   pac   cout   name   put   成功   

原文地址:https://www.cnblogs.com/sweet-ginger-candy/p/11504115.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!