Những câu hỏi liên quan
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
ᝰᦔꫀꪑꪮꪀ
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)
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)
Nguyễn Việt Hà
Xem chi tiết
Minh Lệ
18 tháng 2 2021 lúc 19:13

Program HOC24;

const fi='DL.INP'

fo='DL.OUT'

var s: string;

d,i: byte;

f: text;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,s);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

d:=0;

for i:=1 to length(s) do if s[i] in ['0'..'9'] then inc(d);

write(f,d);

close(f);

end;

begin

ip;

out;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
18 tháng 2 2021 lúc 20:48

const fi='dl.inp'

fo='kq.out'

var f1,f2:text;

s:string;

d,i,dem:integer;

begin

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

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

readln(f1,s);

d:=length(s);

dem:=0;

for i:=1 to d do 

  if s[i] in ['0'..'9'] then inc(dem);

writeln(dem);

readln;

end.

Bình luận (0)
Lê Gia Hiếu
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 5 2022 lúc 20:49

uses crt;

const fi='vb.txt'

var f1:text;

st:string;

i,d:integer;

begin

clrscr;

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

readln(st);

d:=length(st);

for i:=1 to d do 

  if st[i] in ['A'..'Z'] then write(f1,st[i]:4);

close(f1);

readln;

end.

Bình luận (0)
Thọ Phạm
Xem chi tiết
Đặng Duy Hoàng
8 tháng 1 2023 lúc 21:35

Bình luận (0)