Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
Cậu tham khảo nhé!!!
https://hoc24.vn/cau-hoi/viet-chuong-trinh-nhap-mot-xau-tu-ban-phim-thay-ky-tu-39a39-thanh-39i39-va-in-xau-da-thay-ra-man-hinh-thay-tat-ca-chu-39anh39-t.257698320219
uses crt;
var s:string;
begin
clrscr;
write('Nhap xau: '); readln(s);
while pos('a',s)<>0 do
begin
insert('i',s,pos('a',s));
delete(s,pos('a',s),1);
end;
write('Xau sau khi chuyen la : ',s);
readln;
end.
Câu 1:
ho_ten = input("Nhập họ tên: ")
tach_ho_ten = ho_ten.split()
if len(tach_ho_ten) > 1:
ten = tach_ho_ten[-1]
print("Tên của bạn là:", ten)
else:
print("Nhập sai định dạng họ tên")
Câu 2:
s = input("Nhập xâu: ")
hoa = s.upper()
print(hoa)
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i]=#32 then st[i]:='_';
writeln('Xau thay the la: ',st);
readln;
end.
Program HOC24;
var s: string;
i: byte;
begin
write('Nhap xau :'); readln(s);
for i:=1 to length(s) do if s[i]<>'a' then write(s[i]);
readln
end.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]='a' then delete(st,i,1);
writeln(st);
readln;
end.
1.
Program HOC24;
var s: string;
i: byte;
begin
write('Nhap xau : '); readln(s);
for i:=length(s) downto 1 do write(upcase(s[i]));
readln
end.
1:
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
write('Dang dao nguoc cua xau la: ');
for i:=d downto 1 do
write(st[i]);
writeln;
for i:=1 to d do
st[i]:=upcase(st[i]);
write('Xau duoi dang in hoa la: ',st);
readln;
end.
2:
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
i:=pos('anh',st);
while i<>0 do
begin
delete(st,i,3);
insert('em',st,i);
i:=pos('anh',st);
end;
while st[1]=#32 do
begin
delete(st,1,1);
d:=length(st);
end;
while st[d]=#32 do
begin
delete(st,d,1);
d:=length(st);
end;
for i:=1 to d do
while (st[i]=#32) and (st[i+1]=#32) do
begin
delete(st,i,1);
d:=length(st);
end;
writeln('Xau sau khi xu ly la: ',st);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int d,i,d1;
string st;
int main()
{
getline(cin,st);
d=st.length();
while (st[0]==32)
{
st.erase(0,1);
}
while (st[d-1]==32)
{
st.erase(d-1,1);
}
d1=st.length();
for (i=0; i<d1; i++)
if ((st[i]==32) && st[i+1]==32)
{
st.erase(i,1);
i--;
}
cout<<st;
return 0;
}
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]=' ' then st[i]:='_';
writeln('Xau sau khi thay doi la: ',st);
readln;
end.