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.

Var a:array[1..100] of integer;
i,n:integer;
begin
write('Nhap so luong so nguyen trong mang ');readln(n);
for i:=1 to n do
begin
write('nhap phan tu thu ',i,' ');readln(a[i]);
end;
readln;
end.

Var a:array[1..100] of integer;
i,n:integer;
begin
write('Nhap so luong so nguyen trong mang ');readln(n);
for i:=1 to n do
begin
write('nhap phan tu thu ',i,' ');readln(a[i]);
end;

#include <bits/stdc++.h>
using namespace std;
long long n,i,a[1000];
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
sort(a+1,a+n+1);
for (i=n; i>=1; i--) cout<<a[i]<<" ";
return 0;
}

program TinhTBCTimSoNT;
var
ten, lop: string;
n, i, tong, dem: integer;
A: array [1..11] of integer;
trung_binh: real;
function LaSoNguyenTo(x: integer): boolean;
var
i: integer;
begin
if x < 2 then
LaSoNguyenTo := false
else if x = 2 then
LaSoNguyenTo := true
else if x mod 2 = 0 then
LaSoNguyenTo := false
else
begin
i := 3;
while (i <= trunc(sqrt(x))) and (x mod i <> 0) do
i := i + 2;
LaSoNguyenTo := x mod i <> 0;
end;
end;
begin
// Nhập tên và lớp của học sinh
write('Nhập tên của học sinh: ');
readln(ten);
write('Nhập lớp: ');
readln(lop);
// Nhập dãy số nguyên và tính trung bình cộng
repeat
write('Nhập số phần tử của dãy số (n<12): ');
readln(n);
until n < 12;
tong := 0;
for i := 1 to n do
begin
write('Nhập phần tử thứ ', i, ': ');
readln(A[i]);
tong := tong + A[i];
end;
trung_binh := tong / n;
// In tên, lớp, dãy số và trung bình cộng ra màn hình
writeln('Học sinh: ', ten);
writeln('Lớp: ', lop);
write('Dãy số: ');
for i := 1 to n do
write(A[i], ' ');
writeln;
// In các số nguyên tố của dãy số ra màn hình
writeln('Các số nguyên tố của dãy số:');
for i := 1 to n do
if LaSoNguyenTo(A[i]) then
writeln(A[i]);
end.

Câu 1:
#include <bits/stdc++.h>
using namespace std;
long long i,n,k,dem,x;
int main()
{
cin>>n;
cin>>k;
dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x==k) dem++;
}
cout<<dem;
return 0;
}

uses crt;
var n,i,k,dem:integer;
a:array[1..100]of 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 a[i] mod 2=0 then inc(dem);
writeln('So phan tu chan trong day so la: ',dem);
write('Nhap so k='); readln(k);
kt:=0;
for i:=1 to n do
if a[i]=k then kt:=i;
if kt=0 then writeln('Khong co phan tu nao trong day bang ',k)
else writeln('Trong day co phan tu bang ',k);
readln;
end.

#include <bits/stdc++.h>
using namespace std;
long long a[10],i;
int main()
{
for (i=1; i<=10; i++)
cin>>a[i];
for (i=1; i<=10; i++)
cout<<a[i]<<" ";
cout<<endl;
for (i=1; i<=10; i++)
if (a[i]%2==0) cout<<a[i]<<" ";
return 0;
}
uses crt;
var A : array [1 .. 10] of integer;
i : integer;
begin
clrscr;
for i := 1 to 10 do
begin
write('Nhap so thu ', i ,' : ');
readln(A[i]);
end;
write('Cac gia tri chan : ');
for i := 1 to 10 do
if A[i] mod 2 = 0 then
write(A[i], ' ');
readln
end.

#include <bits/stdc++.h>
using namespace std;
long long a[150],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
sort(a+1,a+n+1);
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
Đoạn chương trình nhập vào dãy số nguyên gồm N phần tử nhập từ bàn phím
n = int(input("Nhập số phần tử của dãy: "))
a = [ ]
for i in range(n):
a.append(int(input("Nhập phần tử thứ {0}: ".format(i+1))))