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.

Program hotrotinhoc_hoc24;
const fi='CAPSO.INP';
fo='CAPSO.OUT';
var a: array[1..100] of integer;
i,j,n,x,d: integer;
f: text;
procedure ip;
begin
assign(f,fi);
reset(f);
readln(f,n);
for i:=1 to n do read(f,a[i]);
readln(f);
read(f,x);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
d:=0;
for i:=1 to n do
for j:=i to n do
if i+j=x then inc(d);
write(f,d);
close(f);
end;
begin
ip;
out;
end.

program hotrotinhoc;
var a,b: array[1..8000] of integer;
c,d1: array[1..8000] of ansistring;
j,i,d,d2,n: integer;
t,t1,tg,tg1,st,s: ansistring;
begin
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
write('b[',i,']='); readln(b[i]);
end;
for i:=1 to n do if a[i] mod 2 =0 then
begin
str(a[i],t);
s:=s+t;
end
else
begin
str(a[i],t1);
st:=st+t1;
end;
for i:=1 to n do if b[i] mod 2=0 then
begin
str(b[i],t);
s:=s+t;
end
else
begin
str(b[i],t1);
st:=st+t1;
end;
d:=0;
for i:=1 to length(s) do
begin
inc(d);
c[d]:=s[i];
end;
for i:=1 to d do for j:=i to d do
if c[i]>c[j] then
begin
tg:=c[i];
c[i]:=c[j];
c[j]:=tg;
end;
for i:=1 to d do write(c[i],' ');
d2:=0;
for i:=1 to length(st) do
begin
inc(d2);
d1[d2]:=st[i];
end;
for i:=1 to d2 do
for j:=i to d2 do
if d1[i]<d1[j] then
begin
tg1:=d1[i];
d1[i]:=d1[j];
d1[j]:=tg1;
end;
for i:=1 to d2 do write(d1[i],' ');
readln
end.

Program hotrotinhoc;
const fi='cau2.inp';
fo='cau2.out';
var f: text;
s: ansistring;
i,n,d,max,min: integer;
a: array[1..1000] of string;
procedure ip;
begin
assign(f,fi);
reset(f);
read(f,s);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
s:=s+' ';
while length(s)<>0 do
begin
inc(d);
min:=1001;
max:=0;
a[d]:=copy(s,1,pos(' ',s)-1);
delete(s,1, pos(' ',s));
end;
for i:=1 to d do
begin
if length(a[i])>max then max:=length(a[i]);
if length(a[i])<min then min:=length(a[i]);
end;
write(f,min,' ',max);
close(f);
end;
begin
ip;
out;
end.

Bài 2:
-Sum(a1,b1,30): 110
-sum(a1,a1,b1): 110
-Average(a1,b1,50): 43,(3)
-Max(a1,b1,25): 50
#include <bits/stdc++.h>
using namespace std;
const long long maxn=1e9+10;
long long a[maxn],c[maxn]={0},n;
int main()
{
cin>>n;
for (int i=1; i<=n; i++)
{
cin>>a[i];
c[a[i]]+=1;
}
sort(a+1,a+n+1);
for (int i=0; i<=a[n]; i++)
if (C[i]>0) cout<<i," xuat hien ",C[i]," lan";
}
#include <bits/stdc++.h>
using namespace std;
const long long maxn=1e9+10;
long long a[maxn],c[maxn]={0},n;
int main()
{
cin>>n;
for (int i=1; i<=n; i++)
{
cin>>a[i];
c[a[i]]+=1;
}
sort(a+1,a+n+1);
for (int i=0; i<=a[n]; i++)
if (C[i]>0) cout<<i," xuat hien ",C[i]," lan";
}