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 a:array[1..1000]of integer;
n,i,k,min,vt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
if n=0 then writeln('Moi ban nhap lai')
else begin
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(a[i]:4);
writeln;
min:=a[1];
vt:=1;
for i:=1 to n do
if min>a[i] then
begin
min:=a[i];
vt:=i;
end;
writeln('So nho nhat la: ',min,' tai vi tri: ',vt);
write('Nhap k='); readln(k);
for i:=1 to n do
if i<>k then write(a[i]:4);
end;
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if (10<a[i]) and (a[i]<20) then inc(dem);
writeln(dem);
readln;
end.
uses crt;
var a:array[1..100]of real;
i,n:integer;
t:real;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong cua day la: ',t:4:2);
writeln('Trung binh cong cua day la: ',t/n:4:2);
readln;
end.
uses crt;
var a:array[1..1000]of integer;
i,n,j,tam,t,t1,tam,dem,max:integer;
begin
clrscr;
n:=0;
t:=0;
repeat
inc(n);
write('A[',n,']='); readln(a[n]);
t:=t+a[n];
until t>100;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day so theo chieu tang dan la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
t1:=0;
dem:=0;
for i:=1 to n do
if a[i] mod 3=0 then
begin
t1:=t1+a[i];
inc(dem);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('Tong cac so la boi cua 3 la: ',t1);
writeln('So lon nhat cua day la: ',max);
writeln('So luong so la boi cua 3 la: ',dem);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,s;
int main()
{
cin>>n;
if (n%2==0)
{
s=1;
for (i=1; i<=n; i++)
if (i%2==0) s=s*i;
cout<<s;
}
else
{
s=1;
for (i=1; i<=n; i++)
if (i%2==1) s=s*i;
cout<<s;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long dem,x,n,i,t;
int main()
{
cin>>n;
t=0;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0)
{
dem++;
t+=x;
}
}
cout<<dem<<" "<<t;
return 0;
}