..
( ) ()
19
..
2013
: _ 6 _, ____, _ 1 __
if, begin-end, .
, , , , .
, .
.
1
( 3-19) c if.
x y.
program N3_19;
var x,y,res: real; { }
begin { }
write (' x: ');
readln(x);
write (' y: ');
readln(y);
if (x<0)and(y<0) then res:=x+y;
if x=-1 then res:=x*x+4*x+1;
if (x>0)and(y>0) then res:=x+y*y*y;
writeln (' : ', res:7:5);
writeln(' Enter');
readln;{ }
end. { }
1. x y.
2. x y, .
2
0,001 ( 2-4).
|
n . a b.
: [ a;b ], .
int n , , , 2 , 2n, int1, abs(int-int1) . , n , abs(int-int1)<e.
|
|
.
Program integ;
Var i,n:integer;
x,int,int1,a,b,h,e:real;
Begin
Write(' , b, a');
Readln(b,a);
Write(' ');
Readln(e);
n:=2;int:=0;
repeat
int1:=int;
n:=n*2;
h:=(b-a)/n;
x:=a;
int:=0;
for i:=1 to n do
begin
int:=int+(cos(3*x)/(cos(x))+cos(3*(x+h))/(cos(x+h)))/2*h;
x:=x+h
end;
until abs(int-int1)<e;
writeln(' int = ',int:6:6);
readln;
end.
1. b a.
2. e.
3. n; 0, int=0.
4. int=int1;
5. n=n*2.
6. h=(b-a)/n x=a.
7. int=0.
8. (f(xi)+ f(xi+1 ))/2*h.
9. int= int+ f(x)*h.
10. x=x+h.
11. x<b, ( 6 ).
12. , abs(int-int1)>e, n .. ( 4 ).
13. .
3
5 . . ( 9).
:
1) ;
2) ( ) ;
3) ;
4) .
program mass1;
const n=5;
var m:array[1..n] of real;
i,k: integer; res:real;
begin
for i:=1 to n do
begin
write ('', i, '- ');
readln (m[i]);
end;
res:=0;
for i:=1 to n do { }
begin
res:=res+m[i]*m[i];
end;
res:=res/n;
writeln(' =',res:6:3);
readln;
end.
1. .
2. ;
3.
PASCAL :
1. if, begin-end.
2. , , , , .
3. , .
, .
1. . , , , Microsoft Office. / .., .., ..; . , 1999. 121 .
|
|
2. ( TURBO PASCAL 7.0). / .. , .. , .. , .., ..; . , 1999. 100 .