- (Function) ( ):
1. . .
2. . () .
:
Function ( ): ;
Begin
End;
. , .
, , .
- , , .
. :
,
a, b, n, m - ;
{xi}, {yj} - , n m , .
2. .
Uses crt;
Type
Tmas=array[1..100] of real;
Var a,b,n,m,i,j:byte;
X,Y:Tmas;
S:Real;
Function Summa(Dlmas:byte; Mas:Tmas):Real;
Var Sum:real; i:byte;
Begin
Sum:=0.0;
For i:=1 to Dlmas do
Sum:=Sum+Mas[i];
Summa:=Sum;
End;
Function step(Pok:byte;Osn:byte):real;
Var i:byte; St:real;
Begin
St:=Osn;
For i:=2 to Pok do
St:=St*Osn;
step:=St;
End;
{ }
BEGIN
Write(' - N ');
Readln(N);
Write(' - M ');
Readln(M);
Writeln(' X');
For i:=1 to N do Read(X[i]); readln;
Writeln(' Y');
For j:=1 to M do Read(Y[j]); readln;
Write(' a b '); Readln(a,b);
S:=(Summa(N,X)+Summs(M,Y))/(step(N,a)+step(M,b));
Writeln(' S = ',S);readkey;
END.
- , . . , , , .
n!.
n!.
Var n:integer;
{ }
Function Fact(n:integer):real;
|
|
Begin
If n=0 then Fact:=1
Else Fact:=n*Fact(n-1);
End;
{ }
Begin
Repeat
Writeln(' n<=33');
Readln(n);
Writeln(Fact(n));
Until Eof;
End.
: n>33 Ctrl/z Enter. n>33 .
. , , , , . .
Forward.
: