|
|
back to boardCommon BoardProblem 1084 I got Compilation Error.But my program works correctly in VC6. Please help me. My program: #include <iostream.h> #include <stdio.h> #include <math.h> int main() { long double gardensize; long double cordlenth; long double s; cin >> gardensize >> cordlenth; if(gardensize*sqrt(2) <= 2*cordlenth) { s = pow(gardensize,2); printf("%.3f", s); } else if(gardensize < 2*cordlenth) { s = sqrt(pow(cordlenth,2) - (pow(gardensize,2)/4.00)) *gardensize*2; s = 3.1415926 * pow(cordlenth,2) - (4 * acos (gardensize/(2*cordlenth))*pow(cordlenth,2)) + s; printf("%.3f", s); } else if(gardensize >= 2*cordlenth) { s = 3.1415926 * cordlenth * cordlenth; printf("%.3f",s); } printf("\n"); return 0; } |
|
|