Program Doi_Sang_Chu_Hoa;
Var S , SH: String; i : Byte;
Begin
Write('Nhap vao mot chuoi chu thuong : '); Readln(S);
SH := ''; {tạo xâu rỗng SH}
For i := 1 to Length(S) do SH[i] := UpCase(S[i];
Write('Chuoi da doi sang chu hoa: ',SH);
Readln;
End.
bạn dùng hàm UpCase(kí tự) để đổi từ chữ thường sang chữ hoa
Program Chuoi_In_Hoa;
Uses Crt;
Var i:integer;st:string;
Begin
Clrscr;
Writeln(‘DOI CHUOI SANG CHUOI HOA’);
Write(‘Nhap ho ten:’);readln(st); st[1]:=upcase(st[1]);
For i:=1 to length(St) do
If st[i]=’ ‘ then st[i+1]:=upcase(st[i+1]); Writeln(‘Ho ten sau khi doi lan 1 la: ‘,st);
For i:=1 to length(St) do st[i]:=upcase(st[i]);
Writeln(‘Ho ten sau khi doi lan 2 la: ‘,st);
Readln;
End.
program helo;
ues crt;
var s:string;i:longint
begin
clrscr;
write('s:=');readln(s);
for i:=1 to length(s) do s[i]:=upcase(s[i]);
writeln('s sau khi duoc doi sang chu hoa la');
readln;
end.
program hoc24;
uses crt;
var s:string;i:longint;
procedure nhap(var s:string);
begin
write('nhap xau:');readln(s);
end;
procedure ch(var s:string);
begin
for i:=1 to length(s) do s[i]:=upcase(s[i])
end;
begin
clrscr;
nhap(s);
ch(s);
writeln(s);
readln;
end.