|
|
back to boardWhy WA 7 i dont know why i ahve got WA7 Here is my code(pls help me :D) #include<stdio.h> #include<math.h> long i, j, r; unsigned long nr; int main() { scanf("%ld", &r); for(i = 1; i <= r; i++) for(j = 1; j <= r; j++) if((double)(sqrt(i * i + j * j) - r) >= sqrt(2)) nr++; nr = r * r * 4 - nr * 4; printf("%ld\n", nr); return 0; } Edited by author 25.09.2008 14:42 |
|
|