Những câu hỏi liên quan
Nguyễn Thị Mỹ Tiền
Xem chi tiết
Hân Ngọc
Xem chi tiết
Dao Vo
Xem chi tiết
Thangg PH
Xem chi tiết
Minh Lệ
3 tháng 4 2021 lúc 18:54

Program HOC24;

var S: string;

d,i: byte;

begin

write('S= '); readln(s);

For i:= length(s) downto 1 do write(s[i]);

writeln;

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

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

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

d:=0;

for i:=1 to length(s) do d:=d+1;

write('So tu :',d);

readln

end.

Bình luận (1)
Nguyễn Lê Phước Thịnh
3 tháng 4 2021 lúc 19:16

uses crt;

var s:string[200];

i,d,dem:integer;

begin

clrscr;

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

d:=length(s);

write('Xau viet theo chieu nguoc la: ');

for i:=d downto 1 do 

  write(st[i]);

writeln;

dem:=0;

for i:=1 to d do 

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

writeln('So tu la: ',dem);

readln;

end.

Bình luận (1)
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)
Doan Thai
Xem chi tiết
Dino
Xem chi tiết
Nguyễn Trọng Chiến
26 tháng 3 2021 lúc 21:26

Chương trình:

program bai_10_chuong_4;

uses crt;

var

s: string[100];

i, dem: integer;

Begin

clrscr;

write('Nhap xau vao:'); readln(s); dem:= 0;

for i:= 1 to length(s) do

if ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;

Writeln('Trong xau s co '»dem,' chu so thap phan');

readln;

End.

 

 

 

Bình luận (0)
Nguyễn Lê Phước Thịnh
26 tháng 3 2021 lúc 21:34

uses crt;

var s:string;

i,d,dem:integer;

begin

clrscr;

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

d:=length(s);

dem:=0;

for i:=1 to d do 

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

writeln(dem);

readln;

end.

Bình luận (0)
feng
Xem chi tiết
nguyễn an phát
24 tháng 5 2022 lúc 10:59

program bai1;
uses crt;
var i:integer;
s,s1:string;
begin
  clrscr;
  write('nhap S:');readln(s);
  while pos('C',s)<>0 do
  begin
    insert('LOP11A',s,pos('C',s));
    delete(s,pos('C',s),1);
  end;
  writeln('xau sau khi bien doi la: ',s);
  writeln('do dai cua xau tren la: ',length(s));
  write('nhap s1:');readln(s1);
  if s1[1]=s[1] then writeln('ki tu dau cua hai xau trung nhau')
  else writeln('ki tu dau cua hai xau khong trung nhau');
  readln;
end.

Bình luận (0)
Lê Tuyết Dình
Xem chi tiết