Những câu hỏi liên quan
ᝰᦔꫀꪑꪮꪀ
Xem chi tiết
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:25

Câu 1: 

uses crt;

var st:string;

d,i,dem:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

write('Xau sau khi xoa so la: ');

for i:=1 to d do 

  if not(st[i] in ['0'..'9']) then write(st[i]);

writeln;

dem:=0;

for i:=1 to d do 

  if st[i]=#32 then inc(dem);

writeln('Xau co ',dem,' dau cach');

writeln('Do dai cua xau la: ',d);

readln;

end. 

Bình luận (1)
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:26

Câu 2: 

uses crt;

const fi='kq.out'

var st1,st2:string;

f1:text;

begin

clrscr;

write('Nhap xau thu 1:'); readln(st1);

write('Nhap xau thu 2:'); readln(st2);

assign(f1,fi); rewrite(f1);

if length(st2)>length(st1) then writeln(f1,st2)

else writeln(f1,st1);

close(f1);

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:28

Câu 3: 

uses crt;

var a:array[1..100]of integer;

i,n,t,dem:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

dem:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then

begin

t:=t+a[i];

inc(dem);

end;

writeln('Trung binh cong cac so chan la: ',t/dem:4:2);

readln;

end.

Bình luận (0)
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
nguyen dao
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:09

const fi='vao.inp'

fo='ra.out'

var f1,f2:text;

st:string;

i,d:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

for i:=1 to d do 

  if st[i]='a' then delete(st,i,1);

writeln(f2,st);

close(f1);

close(f2);

end.

Bình luận (0)
Quỳnh Anh Đào
Xem chi tiết
Hello Det
4 tháng 5 2022 lúc 19:27

code pascal

var f,g:text;

var s:string;

begin

assign(f,'cau2.txt'); reset(f);

read(f,s);

assign(g,'KQ.txt'); rewrite(g);

write(g,upcase(s));

close(f);

close(g);

end.

Bình luận (0)
LA VAN CAU
Xem chi tiết
Nguyễn TRƯỜNG Giang
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 4 2022 lúc 21:46

uses crt;

var st:string;

begin

clrscr;

readln(st);

delete(st,3,5);

writeln(st);

readln;

end.

Bình luận (0)