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.
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.
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
dem:=0;
for i:=1 to d do
if st[i] in ['0'..'9'] then inc(dem);
writeln(dem);
readln;
end.
Chương trình:program bai_10_chuong_4;uses crt;vars: string[100];i, dem: integer;Beginclrscr;write('Nhap xau vao:'); readln(s); dem:= 0;for i:= 1 to length(s) doif ('0'<=s[i]) and(s[i]<=’9') then dem:=dem+l;Writeln('Trong xau s co '»dem,' chu so thap phan');readln;End.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i]=#32 then st[i]:='_';
writeln('Xau thay the la: ',st);
readln;
end.
Use crt;
Var S : String;
P: longint;
Begin
Write('Nhap s: '); readln (S);
For P:=length(S) downto 1 do
Write(P);
Readln;
End.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau ban vua nhap la: ',st);
writeln('Xau nguoc la: ');
for i:=d downto 1 do
write(st[i]:4);
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.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i] in ['a'..'z'] then upcase(st[i]);
writeln(st);
readln;
end.
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.
Uses crt;
Var st:string;
I,d:integer;
Begin
Clrscr;
Write('nhap xau:'); readln(st);
D:=length(st);
While st[d]=#32 do
Begin
Delete(st,d,1);
D:=length(st);
End;
For i:=1 to d do
If (st[i]=#32) and (st[i+1]=#32) then delete(st,i,1);
Writeln(st);
Readln;
End.
Uses crt;
Var st:string;
I,d:integer;
Begin
Clrscr;
Write('nhap xau:'); readln(st);
D:=length(st);
While st[d]=#32 do
Begin
Delete(st,d,1);
D:=length(st);
End;
For i:=1 to d do
If (st[i]=#32) and (st[i+1]=#32) then delete(st,i,1);
Writeln(st);
Readln;
End.
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
writeln('Xau vua nhap la: ',st);
for i:=1 to d do
if st[i]=#32 then delete(st,i,1);
writeln('Xau moi la: ',st);
readln;
end.