0 bình luận về “pascal chuyển xâu chữ hoa thành chữ thường”
Program VIET_THUONG_CHU_CAI; 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.
Program VIET_THUONG_CHU_CAI;
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.
Xin ctlhn