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 |
code#include <stdio.h> #include <math.h> #define PI 3.1415926 #define MY 151 int main() { int i, j, n; float x, y, r, R[MY]; scanf("%d", &n); j = 1; for (i = 1; i < MY; ++i) R[i] = sqrt((double)i*100/PI); while (j <= n) { scanf("%f%f", &x, &y); r = sqrt(x*x + y*y); for (i = 1; i < MY; ++i) if (r < R[i]) { printf("Property %d: This property will begin eroding in year %d.\n", j++, i); break; } } 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