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;
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.
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.
Program HOC24;
var s: string;
i: byte;
begin
write('Nhap xau :'); readln(s);
for i:=1 to length(s) do if s[i]<>'a' then write(s[i]);
readln
end.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]='a' then delete(st,i,1);
writeln(st);
readln;
end.
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.
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.
#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;
}
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if (st[i] in ['a'..'z']) or (st[i] in ['A'..'Z']) then inc(dem);
writeln(dem);
readln;
end.
program ki_tu;
uses crt;
var s: string;
d,i,n: integer;
begin
clrscr;
write('nhap xau s: ');readln(s);
n:= length(s);
s:=upcase(s);
write('xau s sau khi duoc in hoa la: ');
writeln(s);
d:=0;
for i:= 1 to n do
if s[i] = 'A' then d:= d+1 ;
writeln('chu cai A xuat hien ',d,' lan');
readln
end.
Uses crt;
Var st:string;
D,i,dem:integer;
Begin
Clrscr;
Write('nhap xau:'); readln(st);
D:=length(st);
Dem:=0;
For i:=1 to d do
If st[i]='A' then inc(dem);
Writeln(dem);
Readln;
End.