| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:我感觉没问题啊,怎么通不过?求救!In Reply To:我感觉没问题啊,怎么通不过?求救! Posted by:ilazyboy at 2012-05-14 19:40:17 > #include<stdio.h>
> #define PI 3.141592635
> int main()
> {
> int i,n,year;
> float x,y,s;
> scanf("%d",&n);
> for(i=0;i<n;i++)
> {
> scanf("%f%f",&x,&y);
> s=0.5*PI*(x*x+y*y);
> if(s%50==0)
> year=s/50;
> else
> year=s/50+1;
> printf("Property %d:This property will begin eroding in year %d.\n",i+1,year);
> }
> printf("END OF OUTPUT.\N");
> return 0;
> }
1.s是float类型,50是整型,%是整型运算吧,我系统上gcc会报错
2.最后那个是printf("END OF OUTPUT.\n");你把回车符的n打成大写了……
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator