IV-кезең
Y:=Copy(X,N,M);
A:=Copy(X,1,3);B:=(X,10,8);
C:=Concat(A,B)
Program Katar4;
Var X:String[17];Y,A,B,C:String;N,M,Z,P:Integer;
Begin X:=’Oblistik gimnazia’;
Z:=Length(X);
P:=Pos(‘azia’,’Oblistik gimnazia’);
Readln (N,M);
Y:=Copy(X,N,M);
A:=Copy(X,1,3);B:=(X,10,8);C:=Concat(A,B);
Writeln (Z,’’,Y,C);
Readln End.
V-кезең
Program Katar5;
Const X=’Oblistik’;Y=’gimnazia’;
Var A,B,C,D:String[15];K:String;I,N:Byte;
Begin A:=’Pentium-I’;B:=’Pentium-II’;C:=’Pentium-III’;
If A>B Then D:=A Else D:=B;
If D>C Then Writeln (‘max=’,D) Else Writeln (‘max=’,C);
K:=X+’’+Y;
If K=Concat(X,Y) Then Writeln (‘K=X+Y’) Else Begin
Writeln (‘K ten emes X+Y’);Writeln (‘K=’,K) End;
Delete(A,8,2);
Writeln (‘A=’,A);
Delete (B,2,6);
Writeln (‘B=’,B);
Insert (‘entium’,B,2);
Writeln (‘B1=’,B);
K:=Copy(Y,1,4);
Writeln (‘K1=’,K);
I:=Pos(K,Y);
Writeln (‘I=’,I);
N:=Length(X+Y);
Write (‘N=’,N);
Writeln (Concat(x’,’,y));
Writeln (‘a-max=’,Upcase(‘a’));
Readln End.
І-кезең
Х жолдық қатарында кездесетін “а”символдарын санап,оларды “в”символымен ауыстыру программасын құру.
Program kat6;
Var X:String;K,N:Byte;
Begin Write (‘Katardin manin engiz:’);Readln (X);
For K:=1 to Length(X) do If X[K]=’a’ Then
Begin N:=N+1;X[K]:=’b’ End;
Writeln (‘Katardin gana mani X=’,X’,katarda’,N,’’a’’ simvoli boladi’);
Readln End.
ІІ-кезең
Program kar7;
Type Katar=String;
Var X:Katar;K,I:Byte;
Begin Write (‘Katardin manin engiz:’);Readln (X);
Repeat
K:=Pos(‘{‘,X);If K>0 Then Begin I:=Pos(‘}’,X);
If I>K Then Delete (X,K,I-K+1) End;
Until K=0;
Writeln (‘Katardin gana mani X=’,X);
Readln End.
Достарыңызбен бөлісу: |