Những câu hỏi liên quan
Nguyễn thị tuyết nhung
Xem chi tiết
đăng hiếu
31 tháng 12 2021 lúc 10:55

chj check ib em ạ

Bình luận (0)
Nguyễn Lê Phước Thịnh
31 tháng 12 2021 lúc 11:29

#include <bits/stdc++.h>

using namespace std;

string s;

int d,i,dem;

int main()

{

cin>>s;

d=s.length();

dem=0;

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

if (s[i]=='a') dem++;

cout<<dem;

return 0;

}

Bình luận (0)
Nguyễn Thảo Vy
Xem chi tiết
Do Ngoc Thao My
Xem chi tiết
Do Ngoc Thao My
Xem chi tiết
Phạm Hào
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 12 2021 lúc 23:06

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i,dem;

int main()

{

getline(cin,st);

d=st.length();

dem=0;

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

if ((97<=st[i] && st[i]<=122) and (st[i]!=".")) dem++;

cout<<dem;

return 0;

}

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)
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)
Trà my
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 12 2022 lúc 13:47

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.

Bình luận (0)
Nguyễn Mai
Xem chi tiết
Minh Lệ
16 tháng 4 2023 lúc 12:28

Program HOC24;

var i,d1,d2: byte;

st1,st2: string[60];

begin

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

//---------------Câu 1-------------------

d1:=0; d2:=0;

for i:=1 to length(st1) do

begin

if st1[i]='A' then d1:=d1+1;

if st1[i]='a' then d2:=d2+1;

end;

writeln('Co ',d1,' ki tu A trong xau');

writeln('Co ',d2,' ki tu a trong xau');

//---------------------- Câu 2 --------------------

st2:=''

for i:=1 to length(st1) do if st1[i] in ['a'..'z'] then st2:=st2+st1[i];

writeln('Xau st2 la: ',st2);

//------------------------------Câu 3--------------------

for i:=1 to length(st1) do st1[i]:=upcase(st1[i]);

write('Xau st1 sau khi in hoa la: ',st1);

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

readln

end.

Bình luận (1)