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:yzl427 at 2012-07-24 21:17:47 #include <stdio.h> #include <stdlib.h> #define pi 3.14159265358979323846264338327950288 int k=0; double r; int n; double sqare; int main( ) { int i; float x,y; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%f%f",&x,&y); r=x*x+y*y; k=0; sqare=0.0; while (r>sqare) { sqare=1.0; k++; sqare=sqare*100*k/pi; } printf("Property %d: This property will begin eroding in year %d.\n",i,k); } 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