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.
câu 1 Uses Crt;
Var St:String;
dem: Array[‘A’..’Z’] Of Byte
; i:Byte;
ch:Char;
Begin Write(‘Nhap xau St: ‘);
Readln(St);
{Khởi tạo mảng} For ch:=’A’ To ‘Z’ Do dem[ch]:=0;
{Duyệt xâu} For i:=1 To Length(St) Do If Upcase(St[i]) IN [‘A’..’Z’] Then Inc(dem[Upcase(St[i])]);
{Liệt kê các ký tự ra màn hình} For ch:=’A’ To ‘Z’ Do If dem[ch]>0 Then Writeln(ch,’ : ’,dem[ch]);
Readln;
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.
Program HOC24;
var s: string;
i,d: byte;
begin
write('Nhap xau :'); readln(s);
d:=0;
for i:=1 to length(s) do if s[i]=' ' then d:=d+1;
write('Xau ',s,' co ',d,' ki tu cach');
readln
end.
uses crt;
var s:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:); readln(s);
d:=length(s);
dem:=0;
for i:=1 to d do
if s[i]=#32 then inc(dem);
writeln(dem);
readln;
end.
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[100];
i,d,kt:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
kt:=0;
for i:=1 to length(st) do
if st[i]<>st[length(st)-i+1] then kt:=1;
if kt=0 then write('Xau doi xung')
else writeln('Xau khong doi xung');
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);
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.
program kitu;
uses crt;
var i,j,k:integer;
s1,s2:string;
begin
clrscr;
write('nhap xau:')readln(s1);
s2:='';
for i:=1 to length(s1) do
if (s1[i]>='1')and(s1[i]<='9')then s2:=s2+21[i];
for i = 1 to 4
k:=i;
for j:=i to length(s)+i-4 do
if s2[k]<s2[j] then k:=j;
if k>i then delete(s,i,k-i);
end;
writeln(copy(s,1,4));
readln;
end.
var a,b:string;
begin
write('a = '); readln(a);
write('b = '); readln(b);
if a[2] = b[length(b)-1] then write('Có trùng') else write('Không trùng');
readln
end.