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.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
const fi='vb.txt';
var f1:text;
st:string;
i,d:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
readln(st);
d:=length(st);
for i:=1 to d do
if st[i] in ['A'..'Z'] then write(f1,st[i]:4);
close(f1);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
string st,a[1000];
int i,d,dem,j;
bool kt;
int main()
{
getline(cin,st);
d=st.length();
a[1]=st[0];
dem=1;
for (i=0; i<=d-1; i++)
{
kt=true;
for (j=1; j<=dem; j++)
if (a[j]==st[i]) kt=false;
if (kt==true)
{
dem++;
a[dem]=st[i];
}
}
for (i=1; i<=dem; i++) cout<<a[i]<<" ";
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
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.
Viết chương trình đếm số lượng mỗi chữ cái có trong xâu s . Giả sử xâu s đc nhập là các kí tự in hoa
![](https://rs.olm.vn/images/avt/0.png?1311)
![](https://rs.olm.vn/images/avt/0.png?1311)
Program HOC24;
const fi='DL.INP';
fo='DL.OUT';
var s: string;
d,i: byte;
f: text;
procedure ip;
begin
assign(f,fi);
reset(f);
read(f,s);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
d:=0;
for i:=1 to length(s) do if s[i] in ['0'..'9'] then inc(d);
write(f,d);
close(f);
end;
begin
ip;
out;
end.
const fi='dl.inp';
fo='kq.out';
var f1,f2:text;
s:string;
d,i,dem:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,s);
d:=length(s);
dem:=0;
for i:=1 to d do
if s[i] in ['0'..'9'] then inc(dem);
writeln(dem);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var st:string;
i,d,dem:integer;
b:char;
begin
clrscr;
write('Nhap xau st:'); readln(st);
d:=length(st);
write('Nhap ki tu b:'); readln(b);
dem:=0;
for i:=1 to d do
if b=st[i] then inc(dem);
writeln(dem);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
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.
cái này đúng
var S:string ;
j:integer;
n,k:byte;
i:char;
begin
k:=0;
write('nhap xau S');
read (S);
for i:= 'A' to 'Z' do
begin
n:=0;
for j:= 1 to length(S) do
if s[j]=i then
n:=n+1;
if n<> 0 then
k:=k+1;
end;
write ('so ki tu chu cai tieng anh in hoa khac nhau trong xau S=',k);
readln
end.
câu b
('đúng ')
var S:string ;
j:integer;
n,k:byte;
i:char;
begin
k:=0;
write('nhap xau S ..');
read (S);
for i:= 'A' to 'Z' do
begin
n:=0;
for j:= 1 to length(S) do
if s[j]=i then
n:=n+1;
if n<> 0 then
begin
write(i,' xuat hien',n,' lan');
writeln(' ');
end;
end;
readln
end.