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.

uses crt;

var st:string;

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

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

begin

clrscr;

readln(st);

d:=length(st);

dem:=1;

a[1]:=st[1];

for i:=1 to d do 

  begin

kt:=0;

for j:=1 to dem do 

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

if kt=0 then

begin

dem:=dem+1;

a[dem]:=st[i];

end;

end;

dem1:=0;

dem2:=0;

for i:=1 to dem do 

begin

if st[i] in ['A'..'Z'] then dem1:=dem1+1;

if st[i] in ['a'..'z'] then inc(dem1);

if st[i] in ['0'..'9'] then inc(dem2);

end;

writeln(dem1);

writeln(dem2);

readln;

end.

12 tháng 4 2023

chuoi = input("Nhập chuỗi: ")

so_lan_A = chuoi.count('A')

print("Số lần xuất hiện của ký tự A trong chuỗi:", so_lan_A)

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.

#include <bits/stdc++.h>

using namespace std;

string st;

int dem,i,d;

int main()

{

getline(cin,st);

d=st.length();

dem=0;

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

if ((st[i]=='a') or (st[i]=='A')) dem++;

cout<<dem;

return 0;

}

 

17 tháng 3 2023

Program HOC24;

var s: string;

i,d: byte;

begin

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

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

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

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

d:=0;

for i:=1 to length(s) do if s[i]=#32 then d:=d+1;

write('Trong xau co ',d+1, ' tu');

readln

end.

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,dem:integer;

begin 

clrscr;

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

d:=length(s);

writeln('Trong chuoi ',s,' co ',d,' ki tu');

writeln('Chuoi dao cua chuoi ',s,' la: ');

for i:=d downto 1 do 

  write(s[i]:4);

writeln;

dem:=0;

for i:=1 to d do 

  if s[i] in ['0'..'9'] then inc(dem);

writeln('So chu so trong xau la: ',dem);

readln;

end. 

15 tháng 1 2021

Bạn ơi cho mình hỏi sao bạn còn thiếu chỗ câu c hay sao?Hình như bạn chưa làm câu c  đúng không ạ.