In lên màn hình 4 dòng chữ cái theo chiều xuôi ; ngược (in hoa và in thường )

2 câu trả lời

Program Hotboy; 

Uses crt; 

Var Ninh:Char;

begin

clrscr;

For Ninh:= 'a' to 'z' do 

Write(Ninh:2); 

writeln;

For Ninh:='z' downto 'a' do 

Write(Ninh:2);

writeln;

For Ninh:= 'A' to 'Z' do 

Write(Ninh:2);

writeln; 

For Ninh:= 'Z'downto 'A' do

Write(Ninh:2);

writeln;

Readln

End.

var a,b,c,d:string;

begin

//In thuong

a:='Dong thu nhat';

b:='Dong thu hai';

c:='Dong thu ba';

d:='Dong thu tu';

//Xuoi

writeln(a);

writeln(b);

writeln(c);

writeln(d);

//Nguoc

for i:=length(a) downto 1 do write(a[i]);

writeln;

for i:=length(b) downto 1 do write(b[i]);

writeln;

for i:=length(c) downto 1 do write(c[i]);

writeln;

for i:=length(d) downto 1 do write(d[i]);

writeln;

//In hoa

a:=upcase(a);

b:=upcase(b);

c:=upcase(c);

d:=upcase(d);

//Xuoi

writeln(a);

writeln(b);

writeln(c);

writeln(d);

//Nguoc

for i:=length(a) downto 1 do write(a[i]);

writeln;

for i:=length(b) downto 1 do write(b[i]);

writeln;

for i:=length(c) downto 1 do write(c[i]);

writeln;

for i:=length(d) downto 1 do write(d[i]);

writeln;

readln

end.

Câu hỏi trong lớp Xem thêm