|
|
back to boardWA 5 Posted by Roland 18 Oct 2009 00:41 What is wrong? My answer is: ans=((int)(360/(2*a)-1))*2*r*sin((a*pi)/180)+r I HAVE THE SAME PROBLEM PLEASE HELP US.... I HAVE THE SAME PROBLEM PLEASE HELP US.... My program is : #include<iostream> #include<cmath> #define PI 3.14159265358979323846264338327950288 using namespace std; double r,a,whole,reminder,side,leftSide; int main() { cin>>r>>a; whole=180/a; reminder=360-whole*(2.0*a); side=2*r*sin(a*PI/180); leftSide=2*r*sin(reminder*PI/360.0); printf("%.12lf",r+(whole-1)*side+leftSide); system("pause"); return 0; } Re: WA 5 you forget about last part for ex input 1 40 you have 3 part with arch = 80 degrees and last 40 degrees (not 80) SOrry for my english I hope that you understand Re: WA 5 Test 5: Input 10.000 30.001 Output 59.999698 |
|
|