Pascal : sin, cos, arctg (. 1). :
;
;
;
;
;
, , :
4. if ( , );
5. ',
6. , : true ( ) false ( );
7. And ( "") or ( "") .
() if :
q 1.
if
Then
Begin
{ , }
{ }
End
Else
Begin
{ , }
{ }
end;
q 2.
if
Then
Begin
{ , }
{ }
end;
( ).
if, then, else "", "", "" . . (true, "", 1), , then. (false, "", 0), , else, .
Case
, , :
case ( , );
- , ;
- (integer) (char) .
case :
case - of
1: begin
{ 1 }
end;
2: begin
{ 2 }
end;
N: begin
{ N }
End
Else
Begin
{ }
end;
end;
case -. begin end , case . , , else, begin end. else , , case.
|
|
case end, begin. End case.
:
q :
case i of
1: z:=i+10;
2: z:=i+100;
3: z:=i+1000;
end;
q :
case i of
1..10: writeln(' ', i:4,' 1 10');
11..20: writeln(' ', i:4,' 11 20');
21..30: writeln(' ', i:4,' 21 30')
else(' ')
end;
X Y . , . . SUM , - , P - .
Y .
, , 2
2
x, y | real | , |
Sum | real | |
M | real | |
p | real |
5.3.
. 2
program prim_1;
{ }
var x,y:real;
sum,m,p:real;
begin
write(' x=');readln(x);
write(' y=');readln(y);
sum:=x*x+y*y;
m:=abs(x-y);
p:=x*y;
writeln(' =',sum:6:3);
writeln(' =',m:6:3);
writeln('=',p:6:3);
readln;
end.
, : (1) , Y; (2) , Y X. .
1:
= 3
Y = 2
sum = 13.000
m = 1.000
= 6.000
2:
= -5
Y = -2
sum = 29.000
m = 3.000
= 10.000
2: . > B, A < B A = B .
.2. -
- .2. .
program prim_2;
{ }
var a,b:real;
Begin
write(' =');readln(a);
write(' b=');readln(b);
if a>b then writeln(' ')
else if a<b then writeln(' ')
else writeln(' ');
end.
3: .
1:
|
|
var age1,age2: integer;
Begin
write(' : '); readln(age1);
write(' : ');readln(age2);
if age1>age2 then writeln(' .')
else if age1<age2 then writeln(' .')
else writeln(' .');
end.
2:
var age1,age2: integer;
Begin
write(' : '); readln(age1);
write(' : ');readln(age2);
if age1>age2 then writeln(' .');
if age1<age2 then writeln(' .');
if age1=age2 then writeln(' .');
end.
4: .
var d,m,y: integer; n: longint;
Begin
writeln(' , , (: 3 12 1964)');
readln(d,m,y);
if(m>=2)then m:=m+1
else
Begin
m:=m+13; y:=y-1;
end;
n:=trunc(365.25*y)+trunc(30.6*m)+d-621050; n:=n-trunc(n/7)*7+1;
case n of
1: write('');
2: write('');
3: write('');
4: write('');
5: write('');
6: write('');
7: write('');
end; writeln;
end.
, . .
1 . .
1. a b, . S .
; ,
a :
2. . :
; ;
3. . :
; ;
4. . :
; ;
5. . :
; ;
6. A, B ha. :
; ; ;
7. B, ha. :
; ;
8. a . S b c:
; ; ;
9. a, ha . b, S.
; ;
10. . :
;
: A(x1, y1) B(x2, y2), :
11. . .
12. a, b, c . R, A , a , B, C.
; ;
13. R . a, S S0 , :
; ;
14. Z1 Z2 :
;
15. , V0 h a, . :
; , , V0x , V0y - V0 X Y. : Y=0.
2. . .
1. .
2. .
3. .
4. ( ) , .
5. . , : , .
|
|
6. 1, 1 2, 2.
7. . : .
8. l.
9. F m1 m2, r .
10. . .
11. a b. , .
12. x y.
13. . .
14. . .
15. . .
3: . .
- , . , ( ), .
- . .
- , . .
- . , , .
- . 10% , 1000 .
- . 3% , 500 ., 5% 1000 .
- -. .
- . .
- . . .
- . , .
- x, y z. x, y z. , .
- a1, b1, c1, a2, b2, c2. , , , ,
( ).
- a, b, c. a £ b £ c, , a > b > c, , .
- :
4: Case
- , . , , " ".
- , : " ", "" "".
- , ( , ). .
- , ( 1 999), , "" . , 12 , 21 . .
- , ( 1 99), , "" . , 5 , 41 . .
- , .
- , .
- .
- , (, , ), .
- , , " " " ". ( , , ).
- , L, S, V ; ; .
- , 0..24, .
- , .
- , . , 2..5.
- , Ch ('A'..'Z', 'a'..'z'), ('0'..'9') ('+', '-', '*', '/'), '', '', ''. ' '.
|
|