|
|
вернуться в форумОбщий форум!!!! MESSAGE FOR THE ADMINISTRATORS !!!! I think that all correct or mistake on variable??? //#1084 #include<iostream> #include<math.h> int main() { using namespace std;
long j=1,k,R,L; double s,pi=3.1415926535; cin>>L>>R; if(L>=2*R) s=pi*R*R; else if (R>(L*sqrt(2.0))/2) s=L*L; else s=2*R*R*atan((L*L-2*R*R)/(L*sqrt((double) 4*R*R-L*L)))+L*sqrt((double) 4*R*R-L*L);
k=s;
while(k>10) { k=k/10; j++; } cout.precision( 3+j ); cout << noshowpoint << s << endl;
return 0; } |
|
|