Program CHUOI_CHU_THUONG;
Uses Crt;
Var i,l:integer;
st:string[50];
Begin
Clrscr;
Writeln('DOI CHUOI SANG CHUOI CHU THUONG');
Writeln('------------------------------------------------------');
Write('Nhap chuoi ky tu: '); Readln(st);
For i:=1 to length(st) do
If (st[i]>='A') and (st[i]<='Z') then
st[i]:= chr(ord(st[i])+32);
Writeln;
Writeln('Chuoi doi thanh chu thuong la : ');
Writeln(st);
Writeln; l:=length(st);
st[l]:=upcase(st[l]);
For i:=l downto 2 do
If st[i]=' ' then st[i-1]:=upcase(st[i-1]);
Writeln('Chuoi cac ky tu cuoi cua tu la ky tu hoa: ');
Writeln(st);
Readln;
End.
Học tốt
Program DOI_CHUOI_CHU_HOA;
Uses Crt;
Var i:integer;st:string;
Begin
Clrscr;
Writeln('DOI CHUOI SANG CHUOI HOA');
Writeln('--------------------------------------');
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.