IV-кезең
F:=a*h;F:=Val(a,h);
Program kat24;
Var a,h:Integer;F:=Real;
Begin
Readln (a,h);
F:=a*h; F:=Val(a,h);
Write (‘F=’,F);
End;
Readln End.
V-кезең
Program kat25;
Var F:real;A,S:Real;
Begin
Readln (A,S);
F:=A*S;F:=Str(A,S);
Writeln (‘F=’,F);
Readln End.
Күрделі есептер
1.Берілген есептен ең ұзын сөзді басып шығаратын программа жаз
Program kat27;
Label1;
Var I,M,I,K,D:Longint;T,N:String;
Begin
Writeln;Write (‘matindi engiz’);readln (t);t:=t+’’;
I:=length(t);M:=0;K:1;I:=1;
While I<=I do begin
If copy (t,I,1)=’’then begin d:=I-K;
If D>M then begin
M:=d;N:=copy(t,k,d);
End;
K:=I+1;End;
1:I:=I+1
End;
Write (‘en usin soz’’,’n,’’’arip sani=’,m);
Readln;End.
2.Текстегі сөзге қандай соңғы әріпке процент шамасы түседі
program Kat24;
Var i,S,I,k,s1:Longint;t,a:string;p:real;
Begin
Writeln;Write (‘matin engiz’);readln(t);t:=t+’’;
I:=Length(t);Write(‘berilgen aripti engiz’);readln (a);
K:=1;S:=0;S1:=0;
For I:=1 To I do begin
If copy(t,I,1)=’’then Begin
If copy (t,K,1)=a then s1:=s1+1;
S:=s+1;K:=K+I+1;
End;
End;
P:=s1*100/s;
Write (‘cozdegi aaripke tusetin procent’’’,a’’’ ten=’,p);
Readln;
End.
Достарыңызбен бөлісу: |