|
|
вернуться в форумwhy wa it's my code: ------------------------------ {deleted} ------------------------------ Edited by author 09.12.2006 21:18 Re: why wa i find my mistake Where is Wrong answer #3 #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; } Помоги мне . . . Edited by author 10.12.2006 01:07 AC!!! program _1084; {$APPTYPE CONSOLE} uses SysUtils,math; const pi=3.1415926535; Var x,l,s,c:real; begin Readln(x,l); X:=x/2; c:=x*sqrt(2); if l>=c then s:=4*x*x; if l<=x then s:=pi*l*l; if not((l>=c)or(l<=x)) then Begin s:=8*(x*sqrt(l*l-x*x)/2+l*l/2*(pi/4-arccos(x/l))) end; writeln(s:0:3); end. Re: AC!!! program _1084; {$APPTYPE CONSOLE} uses crt; const pi=3.1415926535; Var x,l,s,c:real; begin Readln(x,l); X:=x/2; c:=x*sqrt(2); if l>=c then s:=4*x*x; if l<=x then s:=pi*l*l; if not((l>=c)or(l<=x)) then Begin s:=8*(x*sqrt(l*l-x*x)/2+l*l/2*(pi/4-arccos(x/l))) end; writeln(s:0:3); end. Edited by author 24.11.2007 16:45 Edited by author 24.11.2007 16:45 |
|
|