|
|
back to boardDiscussion of Problem 1020. RopeWhy do I get CE????? Please help!!!!! #include <iostream.h> #include <math.h> int main(){ int N, R; cin>>N>>R; int i; double t1_x, t2_x, tf_x, t1_y, t2_y, tf_y; cin>>tf_x>>tf_y; t1_x=tf_x; t1_y=tf_y; double sum_l=0; for(i=1; i<N; i++){ cin>>t2_x>>t2_y; sum_l+=sqrt((t2_x-t1_x)*(t2_x-t1_x)+(t2_y-t1_y)*(t2_y-t1_y)); t1_x=t2_x; t1_y=t2_y; } if (N>1) sum_l+=sqrt((t2_x-tf_x)*(t2_x-tf_x)+(t2_y-tf_y)*(t2_y-tf_y)); int sum=int((sum_l+2*R*2*acos(0))*100); cout<<double(sum)/100; return 0; } Re: Why do I get CE????? Please help!!!!! #include <iostream> using namespace std; NOT #include <iostream.h> Re: Why do I get CE????? Please help!!!!! I know my mistake. I tryed to count acos(0), but 0 is int and acos has double parameters. I changed to acos(0.0) Edited by author 01.06.2004 20:20 Edited by author 01.06.2004 20:27 |
|
|