Break , .
1
2
If <> then Break
Continue . Ÿ Goto< >.
: X ὲ (ὲ>0)
K=0
A[0]
ὲ.
K=1
A[1]
(A[k])/(A[k-1])=R
A[k]=a[k-1]*R
, .
k=0 .
:
program ex;
Var
x,eps:real;
a,s:real;{ }
k: word;{ }
R: real;{ }
Begin
writeln (' x ');
readln(x,eps);
k:=0; A:=x;{ k=0}
S:=0;
while Abs(A)>=eps do
Begin
S:=s+A;
inc(k);
R:=sqr(X)*(2*K-1)/(k*(2*k+1));
A:=A*R;
end;
Writeln(' -',S);
writeln(' - ',k);
readln
end.
3:
z=x+cos(y) x, a h1, y, d h2. {xi,yj,},
:
program ex2;
Var
x,y,z:real; { }
H1,H2:real; { }
A,B,C,D:real; { }
N,M:word; { }
I,J:word;
Begin
writeln(' x,y');
readln(a,b,c,d);
writeln('enter steps H1,H2');
readln(h1,h2);
n:=round((b-a)/h1);
m:=round((d-c)/h2);
y:=c;
for I:=0 to M do { Y}
Begin
writeln('y=',Y:10);
X:=A;
for J:=0 to N do { y=const}
Begin
Z:=x+cos(y);
writeln('x=',x:12,'z=', Z:12);
x:= X+h1;
end;
y:=y+h2; { y}
readln
End
end.
.
F9X,Y)=(x^3)+Sin(x)+y, x [a b ] delta(X), Y [c,d] Q=((T*x)+(x^2)/18 < 8, delta(y1), delta(y2).
program A1;
Var
x,y,a,b,c,d,Q,dx,dy1,dy2,F,T:real;
Begin
writeln(' a,b,c,d,dx,dy1,dy2,T');
readln(a,b,c,d,dx,dy1,dy2,T);
X:=a;
while X<=b do
Begin
y:=c;
while y<=d do
Begin
f:=sqr(x)*x+Sin(x)+y;
writeln('F=',f,'x=',x,'y=',y);
Q:=((T*x+SQR(x))/18);
if Q<8 then y:=y+dy1 else y:=y+dy2;
end;
x:=x+dx;
end;
end.
:
.
.
|
|
1.
- .
2. .
3. .
- .
1:
.
A
AB
..
ABCZ
program A1;
Var
c, c1:char;
Begin
for c:= 'A' to 'Z' do
Begin
for c1:='A' to c do
write(c1);
writeln;
end;
end.
. .
, | |||
. : Type {} < > = (<1>,<2>,,< n>); var{} <>:< >; . 0. | : . |
Read\write.
If case .
( ) | |||
.
, .
.
:
- ;
- ;
-
- : a-5,a-4,..a10;
- : aa,ab,..az;
- : afalse,atrue;
- : ared,ablue..;
, .
:
1) Type:
Type
T_array= array [T] of ta;
Var
a,b,c:T_array;
2) Type:
Var
a,b,c:: array [t] of ta;
t_array - { }
t- { , ;( longint)}
ta- { .( )}
Ta , t_array . T Ta , Type.
, ( ).
:
Const
N=<>;
Var
a:= array [0..N] of real;
:
Const
M=0;
N=<>;
Type
T=M..N;
t_array= array [T] of real;
|
|
Var
a:t_array;
, .
.
Type
mas1= array [1..20] of real; { - }
color=(red,white,blue);{}
mas2= array [color] of color;{ - }
diap=1..100;
mas3= array [diap] of real;
Var
x:mas1;
y:mas2;
z:mas3;
X:x[1],x[2],.x[20]; .
Y: y[red],y[white],y[blue];
Z:Z[1].Z[100] .
:
:
writeln(' ');
writeln(' ',N);
for i:=1 to N do read(A[i]);
readln;
:
writeln(' ',N);
for i:=1 to N do writeln(A[i],'');
readln;
1. , c1,c2,c3cn , a1,a2..a30 b1b40.
program pr1;
Const
nc=<>;
na=30;
nb=40;
Var
a: array [1..na] of real;
b: array [1..nb] of real;
c: array [1..nc] of real;
ia, ib, ic: word; { }
Begin
writeln (' C, :',nc);
for ic:=1 to nc do
read(c[ic]);
readln;
writeln(' A, :',na);
for ia:=1 to na do
read(a[ia]);
readln;
writeln(' B, :',nb);
for ib:=1 to nb do
read(b[ib]);
readln;
for ic:= 1 to nc do
if c[ic]<0 then break;
for ic:= 1 to nc do
if b[ib]<0 then break;
for ic:= 1 to nc do
if a[ia]<0 then break;
if (ic,ia) and (ic,ib) then writeln('true')
else writeln('false');
readln;
end.
, , .
1)
2) ().
1)
Const
n=10; m=13;
Var
C: array [1..n,1..m] of real;
2)
type te= array [1..m] of real;
Var
c: array [1..n] of te;
.
, , . .
C[i]:=C[L] i- L- ,
for j:=1 to m do
C[i,j]:=c[L,j];
I.
Var
a: array [1..20,1..30] of integer;
II.
Var
a: array [1..20] of array [1..30] of integer;
, 20 30 . .
, , 5 6 A[5][6] A[5,6].