|
|
back to board{C++} Why wrong???? #include<iostream.h> #include<math.h> int main() { double pi; double l, r,alpha,segm,treug,delta; cin>>l>>r; pi=3; l/=2; if(r<=l/2) cout<<pi*r*r; if(r>(l*sqrt(2))) cout<<l*l*4; else { alpha=2*acos(l/r); segm=pi*r/(2*alpha); treug=l*sqrt(((r*r)-(l*l))); delta=segm-treug; cout<<pi*r*r-4*delta; } return 0; } Re: {C++} Why wrong???? Sorry pi=3,145 Why when inpus is: 3 1 Output is: -1.#IND ??? Compiler: Visual C++ 6.0 |
|
|