Những câu hỏi liên quan
Nguyễn Nhật Lệ
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 4 2021 lúc 12:58

uses crt;

var st:string;

i,d,dem:integer;

begin

clrscr;

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

d:=length(st);

dem:=0;

for i:=1 to d do 

  if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem);

writeln(dem);

readln;

end.

Bình luận (0)
Do Ngoc Thao My
Xem chi tiết
Ngô Bá Hùng
16 tháng 4 2023 lúc 20:15

program ChuyenXauSangChuThuong;
var
  str: string; 
  i: integer; 

begin
  write('Nhap mot xau ky tu: ');
  readln(str); 
  for i := 1 to Length(str) do
    str[i] := LowerCase(str[i]); 
  writeln('Xau ky tu chuyen thanh chu thuong la: ', str); 
end.

Bình luận (0)
Do Ngoc Thao My
Xem chi tiết
Do Ngoc Thao My
Xem chi tiết
Khánh Mỹ
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 19:42

uses crt;

var st,s:string;

    i,d,dem,kt,j,dem1:integer;

begin

clrscr;

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

writeln('Xau vua nhap la: ',s);

d:=length(s);

for i:=1 to d do

  if s[i]=#32 then delete(s,i,1);

dem:=1;

st[1]:=s[1];

for i:=1 to d do

  begin

     kt:=0;

     for j:=1 to dem do

       if s[i]=st[j] then kt:=1;

     if kt=0 then

        begin

           inc(dem);

           st[dem]:=s[i];

        end;

  end;

for i:=1 to dem do

  begin

     dem1:=0;

     for j:=1 to d do

       if st[i]=s[j] then inc(dem1);

     writeln(st[i],' xuat hien ',dem1,' lan');

  end;

readln;

end.

Bình luận (0)
Lương Ngọc Anh
Xem chi tiết
Phía sau một cô gái
31 tháng 3 2023 lúc 20:25

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)

Bình luận (0)
Nguyễn Cảnh Hùng
Xem chi tiết
Đỗ Ngọc Trinh
25 tháng 2 2018 lúc 10:40

Var a: string;

 i, Dem: integer;

Begin

 writeln(‘nhap xau:’);

 Readln(a);

 Dem:=0;

 For i:=1 to length(a) do

 If (‘a’<=a[i]) and (a[i]<=’z’)

  Dem:= Dem+1;

 Writeln(Dem);

 Readln

End.

Bình luận (0)
Nguyễn Vy
Xem chi tiết
Minh Lệ
10 tháng 5 2021 lúc 0:49

Program HOC24;

var s: string;

begin

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

write('Xau sau khi loc: ');

for i:=1 to length(s) do

if s[i] in ['A'..'z'] then write(s[i]);

readln

end.

Bình luận (0)
Harunastu
Xem chi tiết
Minh Lệ
18 tháng 1 2021 lúc 19:40

Program HOC24;

var s: string;

tg,d,max,i: byte;

code: integer;

begin

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

// cau a

for i:=1 to length(s) do if s[i] in ['a'..'z'] then write(upcase(s[i]));

//------

writeln;

//-cau b

for i:=length(s) downto 1 do if s[i] in ['0'..'9'] then write(s[i]);

//------

writeln;

//---cau c

d:=0;

for i:= 1 to length(s) do

if s[i] in ['0'..'9'] then 

begin

val(s[i],tg,code);

if tg>max then max:=tg;

d:=d+1;

end;

if d=0 then write('Khong co chu so trong day') else write('Chu so lon nhat la : ',max);

readln 

end.

Bình luận (1)
Nguyễn Lê Phước Thịnh
18 tháng 1 2021 lúc 21:32

uses crt;

var st,st1:string;

d,i,d1,max,x,y:integer;

begin

clrscr;

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

d:=length(st);

writeln('Day cac ki tu thuong doi sang chu hoa la: ');

for i:=1 to d do 

  if st[i] in ['a'..'z'] then write(upcase(st[i]):4);

st1:=''

for i:=1 to d do 

  if st[i] in ['0'..'9'] then st1:=st1+st[i];

d1:=length(st1);

for i:=d1 downto 1 do 

  write(st1[i]:4);

writeln;

max:=0;

for i:=1 to d1 do 

  begin

val(st1[i],x,y);

if max<x then max:=x;

end;

writeln('Chu so lon nhat trong xau la: ',max);

readln;

end.

Bình luận (1)