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 |
我看了,你根据我的理解看看!In Reply To:那错了!!!!帮我看一下呀!大师兄! Posted by:y05zyg at 2006-03-07 18:58:57 //你对题目的理解有错,不是你每次输入一个坐标,就打印出结果的 //第二你没有对其判断就进行加一的操作,如果它恰好被除断,也就是说它的模为0,此时就不能加一了 //第三你没有对输入的t进行判断,如果输入为负数,那该怎么办 //第四你没有对Y值进行判断,它不能是负数。 //这个是我用C写的,对你应该有帮助! #include <stdio.h> #include<math.h> //1005 int main() { int m,i; int n[10]={0}; float x,y; double area; do scanf("%d",&m); while(m<=0); for(i=0;i<m;i++) { scanf("%f%f",&x,&y); if(y>=0) { area=3.14*(x*x+y*y); area=area/100; n[i]=(int)area; if(area>n[i]) n[i]=n[i]+1; } } for(i=0;i<m;i++) if(n[i]!=0) printf("Property %d: This property will begin eroding in year %d.\n",i+1,n[i]); printf("END OF OUTPUT.\n"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator