Những câu hỏi liên quan
Phạm Hà Thương
Xem chi tiết
NTKL
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 1 2022 lúc 10:13

Bài 2: 

#include <bits/stdc++.h>

using namespace std;

string st;

int d;

int main()

{

getline(cin,st);

d=st.length();

cout<<d;

return 0;

}

Kiều Vũ Linh
19 tháng 1 2022 lúc 8:59

Bài 1:

Var so,i,n,dem:integer;

Begin

Write('Nhap so luong so n = ');readln(n);

For i:=1 to n do

Begin

Write('Nhap so thu ',i);readln(so);

If so mod 2 = 0 then dem:=dem+1;

End;

Write('Co ',dem,' so chan');

Readln;

End.

Bài 2:

Var st:string;

Begin

Write('Nhap vao xau ki tu ');readln(st);

Write(' Xau vua nhap co do dai la ',length(st));

Readln;

End.

NGUYỄN VIẾT LUẬN
Xem chi tiết
Nguyễn khánh thành
Xem chi tiết
Do Ngoc Thao My
Xem chi tiết
Do Ngoc Thao My
Xem chi tiết
Asuna
Xem chi tiết
LINH VU HA NGOC
Xem chi tiết
Nguyễn Hạnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 4 2021 lúc 19:21

uses crt;

var s:string;

i,d,dem1,dem2,dem3,dem4:integer;

begin

clrscr;

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

d:=length(s);

dem1:=0;

dem2:=0;

dem3:=0;

dem4:=0;

for i:=1 to d do 

  begin

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

else if st[i] in ['a'..'z'] then inc(dem2)

else if st[i] in ['A'..'Z'] then inc(dem3)

else inc(dem4);

end;

writeln('So luong ky tu so la: ',dem1);

writeln('So luong ky tu thuong la: ',dem2);

writeln('So luong ky tu hoa la: ',dem3);

writeln('So luong ky tu dac biet la: ',dem4);

readln;

end.

Anh Thư
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 4 2021 lúc 20:20

2:

uses crt;

var st:string;

d,i,dem1,dem2:integer;

begin

clrscr;

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

d:=length(st);

dem1:=0;

dem2:=0;

for i:=1 to d do

  begin

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

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

end;

writeln('So ki tu la chu so la: ',dem1);

writeln('So ki tu la chu cai la: ',dem2);

for i:=1 to d do 

  if st[i] in ['0'..'9'] then delete(st,i,1);

writeln('Xau sau khi xoa cac chu so la: ',st);

readln;

end.