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.

23 tháng 2 2023

string = input("Nhập vào một xâu kí tự: ")

count = string.count('tiền')

print('Xâu kí tự có ', count, 'từ "tiền"')

uses crt;

var s:string;

i,d:integer;

begin

clrscr;

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

d:=length(s);

for i:=1 to d do 

  if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then delete(s,i,1);

writeln('Xau sau khi xoa het ki tu chu la: ',s);

readln;

end.

24 tháng 12 2022

uses crt;

var st:string;

dem,i,d:integer;

begin

clrscr;

readln(st);

dem:=0;

d:=length(st);

for i:=1 to d do

if st[i]=' ' then inc(dem);

write(dem);

readln;

end.

30 tháng 4 2017

Var a: string;

  i, Dem: integer;

Begin

 writeln(‘nhap xau:’);

 Readln(a);

 Dem:=0;

 For i:=1 to length(a) do

 If a[i] =’ ‘ then

  Dem:= Dem+1;

 Writeln(Dem);

 Readln

End.

25 tháng 2 2018

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.

20 tháng 8 2019

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’) then

  Dem:= Dem+1;

 Writeln(Dem);

 Readln

End.