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.
![](https://rs.olm.vn/images/avt/0.png?1311)
program FUTURE;
var n,dem:int64;
a:array[1..1000000] of int64;
i,j:longint;
kt:boolean;
function KTSNT(n:int64):boolean;
var i:longint;
kt:boolean;
begin
if n < 2 then KTSNT := false
else begin
kt := true;
for i:= 2 to trunc(sqrt(n)) do
if n mod i = 0 then
begin
kt := false;
break;
end;
if kt = true then KTSNT := true
else KTSNT := false;
end;
end;
BEGIN
readln(n);
for i := 1 to n do read(a[i]);
dem := 0;
for i := 1 to n do
begin
if KTSNT(a[i]) then continue
else if a[i] = 1 then continue
else
begin
kt := true;
for j := 2 to a[i]-1 do
if a[i] mod j = 0 then
if KTSNT(j) = false then
begin
kt := false;
break;
end;
end;
if kt = true then inc(dem);
end;
write(dem);
END.
![](https://rs.olm.vn/images/avt/0.png?1311)
Program HOC24;
var a: array[1..10] of integer;
i,n,d,j: integer;
function ucln(x,y: integer): integer;
var t: integer;
begin
while y<>0 do
begin
t:=x mod y;
x:=y;
y:=t;
end;
ucln:=x;
end;
begin
write('Nhap N='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
d:=0;
for i:=1 to n do
for j:=i to n do
if ucln(a[i],a[j])=1 then d:=d+1;
write('Co ',d,' cap so nguyen to cung nhau');
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long i,a,b;
int main()
{
cin>>a>>b;
for (i=1; i<=min(a,b); i++)
if ((a%i==0) and (b%i==0)) cout<<i<<" ";
return 0;
}