Cách 1: Có sử dụng
uses crt;
var st:string;
{---------------------------chuong-trinh-con--------------------------}
procedure cd(var s:string);
var i,d:integer;
begin
d:=length(s);
for i:=1 to d do
s[i]:=upcase(s[i]);
for i:=1 to d do
write(s[i]);
end;
{--------------------------chuong-trinh-chinh--------------------------}
begin
clrscr;
write('Nhap xau:'); readln(st);
cd(st);
readln;
end.
Cách 2: Không sử dụng
uses crt;
var st:string;
d,i:integer;
begin
clrscr;
write('nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
st[i]:=upcase(st[i]);
for i:=1 to d do
write(st[i]);
readln;
end.