K
Khách

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.

7 tháng 6 2020

Program HOC24;

var s: string;

n,i: integer;

a: array[1..32000] of string;

function chuyen(x: string): string;

begin

x[1]:=upcase(x[1]);

chuyen:=x;

end;

begin

write('Nhap xau : '); readln(s);

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);

writeln('Xau sau khi xoa dau cach : ',s);

s:=s+' ';

while length(s)<>0 do

begin

st:=copy(s,1,pos(' ',s)-1);

n:=n+1;

a[n]:=st;

delete(s,1,pos(' ',s));

end;

for i:=1 to n do write(chuyen(a[i]),' ');

readln

end.

31 tháng 3 2023

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)

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i;

int main()

{

getline(cin,st);

d=st.length()

for (i=0; i<=d-1; i++)

if (('a'<=st[i]) and (st[i]<='z')) st[i]=st[i]+32;

for (i=0; i<=d-1; i++)

cout<<st[i];

return 0;

}

21 tháng 3 2022

Cho em lời giải với ạ em đang thi ạ

 

6 tháng 3 2023

Program HOC24;

var s: string;

i: byte;

begin

write('Nhap xau: '); readln(s);

for i:=1 to length(s) do if (s[i]<>#32) and (s[i] in 'A'..'z') then 

begin

upcase(s[i]); write(s[i]);

end;

readln

end.

9 tháng 9 2023

thiếu array kìa dmmm mẹ m béoooo

 

16 tháng 3 2021

#include <bits/stdc++.h>

using namespace std;

string st1,st2;

int d1,d2;

int main()

{

cin>>st1>>st2;

d1=st1.length();

d2=st2.length();

if (d1<d2) cout<<st1;

else cout<<st2;

return 0;

}

D
datcoder
CTVVIP
19 tháng 12 2023

Program HOC24;

var s: string;

i,x: byte;

begin

readln(s);

//-----------Câu a

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,1);

writeln(s);

//-------------Câu b

s[1]:=upcase(s[1]);

for i:=1 to length(s) do

if s[i]=#32 upcase(s[i+1]);

writeln(s);

//--------------Câu c

for i:=1 to length(s) do

if s[i]=#32 then x:=i;

for i:=x+1 to length(s) do

write(s[i]);

//---------------------------

readln

end.