.


:




:

































 

 

 

 


ascii 1




Ͳ - 1


6.050702 "",
" "

 

"ϲ"

 

 

ϲ


-1: ' 6.050702 "", " " / . .., ..ʳ, ... .: ϲ, 2011. 198 .

 

"ϲ"

( 6 24 2011 .)

 

 

 

Ͳ - 1


6.050702 "",
" "

 

 

:

, . . , .

ʳ , . . , .

, /., .

 

³ .., . . , .

 

.., . . , .

 

 


 

-1 ѳ.

, , .

' . ϳ , , . , , .

' . 4, . . , , , , , . .

urbo ascal 7.0 Turbo C 3.0 .

 


' 1

ί ֲ ASCII

, "", File, Compile, Run .

 

1. Ͳ ²Ҳ

 

1.1. ' , Program, .

Uses (), Type ( ), Const (), Var (), Label (), Procedure (-), Function (-), , . , . , .. , . Uses, , .

, . Begin, End .

1.2. (ASCII), 1963 . . 8 ( ), 7 , . 7 27=128 , 33 ( , ) 95 ( , , ) . , ASCII , 128 (28=256). , , 437 ϳ , 850 , 866 . , , , . ASCII .

16- UniCode, 216=65536 . , .. , , 30 . . , , Windows.

1.3. ASCII ' :

1) (Esc,Tab,Enter,BackSpace) ;

2) , Nul, Alt . , 65. Alt-65. ' Alt;

3) , Nul, Ctrl , 40 . , Bel () 07. 07+40=47 G. Bel Ctrl-G.

1.4. ASCII Chr(I), 0 255 .

1.5. ij, Chr Ord(Ch), Ch, , .

1. .

 

Program Code_Key;

Uses Crt;

Var

Ch: char;

Begin

TextColor (blue);

TextBackground (lightgray);

ClrScr;

Writeln (' i');

Ch:= ReadKey;

if Ch = #0 then

begin

Ch:= ReadKey;

WriteLn(' i ',

Ord(Ch));

end

else

WriteLn(' i ASCII ',

Ord(Ch));

Readln;

End.

 

2.

 

Code_ASCII, ASCII , , File,Compile,Run . ASCII.

 

Program Code_ASCII;

Uses Crt;

Var I:byte;

Begin

TextBackground (lightgray);

ClrScr;

TextColor (blue);

Writeln;

Write (' ':25,' i i');

TextColor (black);

Write (' ASCII');

Window (10,4,80,25);

For I:=0 to 255 do

begin

ClrScr;

TextColor (red);

Write (' : ');

TextColor (yellow);

Writeln (I);

TextColor (red);

Write (': ');

TextColor (yellow);

Writeln (Chr (I):2);

TextColor (red);

Writeln;

TextColor (green+ blink);

GotoXY (17,19);

Write ('i i "ENTER" ');

Readln;

end;

Readln;

Window (1,1,80,25);

End.

 

3. Ͳ

 

3.1. .

3.2. ASCII.

3.3. ASCII.

3.4. .

3.5. .


' 2

Ͳ ² ""

"" , Edit .

 

1. Ͳ ²Ҳ

 

1.1. if case. .

1.2. ( <..> , , )

 

if <> then < 1> else < 2>;

 

<> True, , < 1>. <> False, , < 2>. ,

if A>B then C:=A+B else C:=A-B;

 

then else - , begin..end, ,

 

If A>B then

Begin

C:=A+B;

D:=A*B;

End

Else

Begin

C:=A-B;

D:=A/B;

end;

else ; , if .

<> : and, Δ or, Ͳ not, Δ xor, ,

 

if (A>B)and(C<=D)or(C>0) then C:=A+B else C:=A-B;

if else -, ,

 

if A>B then C:=A+B;

 

, <> False, if .

if , , - . 䳿 then else - if begin..end, ,

 

If A>B then

Begin

if C<=D then C:=A+B else C:=A-B;

End

Else

C:=A/B;

1. , , 1-, 2- 3- .

 

Program If_Kosmos;

Uses CRT;

Const

V1=7.9; { , /}

V2=11.2; { , /}

V3=16.6; { , /}

Var

V:real;

Begin

TextBackGround (lightgray);

ClrScr;

TextColor (blue);

GotoXY (7,2);

Writeln (' I

I ');

TextColor (red);

GotoXY (9,4);

Write ('i i , /: ');

TextColor (black);

Readln (V);

GotoXY (9,6);

TextColor (yellow);

 

if V<V1 then

Writeln (' !!!');

if (V>=V1)and(V<V2) then

Writeln (' i!!!');

if (V>=V2)and(V<V3) then

Writeln (' i

!!!');

if V>V3 then

Writeln (' !!!');

 

Repeat Until KeyPressed;

End.

 

1.3. case .

 

Case<>of

<1- >: < 1>;

<2- >: < 2>;

<N- >: < N>;

else <>;

end;

 

< > < 1> < N>. , <> else -. <>, , - () , , . ,

 

Case J of

1: C:=A+B;

3: C:=A-B;

7: C:=A*B;

else C:=A/B;

end;

else -, ,

 

Case J of

1: C:=A+B;

3: C:=A-B;

7: C:=A*B;

end;

 

' , , ,

 

Case J of

1,2: C:=A+B;

3,4,6: C:=A-B;

7..13: C:=A*B;

end;

 

, begin..end, ,

 

Case J of

Begin

C:=A+B;

D:=(A-B)/2;

end;

3: C:=A-B;

7: C:=A*B;

else C:=A/B;

end;

2.

 

, . Edit .

2.1. , (), (,).

2.2. ϲ , , 쳿, . ϳ 䳿, "4' "5" .

2.3. ϲ , "3", "4", "5", . , "3", "4" 25 %, "5".

2.4. , , , ' . , , ' .

2.5. ϲ , , . 쳿, ( ), , .

2.6. ϲ , , "3", "4", "5" . , 3,9.

2.7. ϲ , , , . , "4".

2.8. ϲ, "3", "4", "5" , . , .

2.9. ϲ , , . , "5", "4'.

2.10. ax2+bx+c=0. .

 

3. Ͳ

 

3.1. .

3.2. .

3.3. .

3.4. .

3.5. .

3.6. .


' 3

² ""

"" , Search, Help .

1. Ͳ ²Ҳ

1.1. , .

for. , while repeat.

1.2. for , 1 -1. , ,

 

for <> := <..> to <..> do <>;

<> <..> <..> - () , . , . , <> . ϳ . .

, ,

 

for I:=3 to 21 do Writeln (I);

 

, begin..end, ,

 

for I:=3 to 21 do

Begin

C:=A+B;

D:=A-B;

Writeln (I,C,D);

end;

䒺 -1 ( ) for

 

for <> := <..> downto <..> do <>;

 

, , ,

 

for I:=23 downto 11 do

Begin

C:=A+B;

D:=A-B;

Writeln (I,C,D);

end;

 

1. 12.

 

Program Dobutok_Array;

Uses Crt;

Const

n=12;

Var

A: array [1..n] of real;

I: byte;

Dobutok: real;

Begin

TextBackGround (lightgray);

ClrScr;

TextColor (yellow);

GotoXY (17,2);

Writeln (' I I');

GotoXY (25,4);

Write ('i i ');

TextColor (black);

for I:= 1 to n do

begin

GotoXY (49,4);

Write ('a[',i,']= ');

Read (A[i]);

GotoXY (49,4);

ClrEol;

end;

Dobutok:= 1;

for I:= 1 to n do Dobutok:=Dobutok* A[i];

TextColor (red);

GotoXY (21,7);

Writeln (' i i: ', Dobutok:9);

Repeat Until KeyPressed;

End.

 

1.3. - , , . , .

 

while <> do <>;

 

<> , <> True, , ,

 

while A>B do C:=A+B;

 

, begin..end. , , 10 4 䒺 -2

 

:=10;

while A>=4 do

Begin

C:=A+D;

write (C);

A:=A-2;

end;

 

1.4.

 

Repeat

< 1>;

< 2>;

< N>;

until <>;

 

, <> False, , ,

 

:=10;

Repeat

C:=A+D;

write (C);

A:=A-2;

until A<4;

1.5. , , . , . while repeat.

1.6. , begin..end, , <> True,

 

While<>do

Begin

< 1>;

< 2>;

< N>;

end;

 

1.7. repeat.. until , <> False,

 

Repeat

< 1>;

< 2>;

< N>;

until <>;

 

2. k, y=xk/k , .

 

Program Minimum_K;

Uses Crt;

Var

a, x, y:real;

k:word;

Begin

TextBackground (lightgray);

ClrScr;

TextColor (blue);

Writeln (' "",

I y=x^k/k < a');

Writeln;

TextColor (red);

Write (' ':9,'ei "a" "x": ');

TextColor (black);

Readln (a, x);

k:=0;

 

repeat

k:= k+1;

y:= Exp(k*Ln(x))/k;

until y < a;

 

TextColor (yellow);

Writeln;

Writeln (' ':9,'i y < a = ',k);

Readln;

End.

 

1.8. , . , . , . for, while repeat.

1.9. for , , .

3. 35.

 

Program Summa_String;

Uses Crt;

Const

N=3;

M=5;

Var

A:array [1..N,1..M] of real;





:


: 2016-10-22; !; : 444 |


:

:

, .
==> ...

1773 - | 1677 -


© 2015-2024 lektsii.org - -

: 0.214 .