#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a, b;
int mass[10];
srand(time(0));
cout << "Enter a: ";
cin >> a;
cout << "Enter b: ";
cin >> b;
for(int i = 0; i < 10; i++)
{
mass[i] = rand() % (b - a + 1) + a;
cout << mass[i] << ' ';
}
cout << endl;
return 0;
}
#include <iostream>
using namespace std;
int isSimple (int x)
{
int retVal = 1;
int i = 2;
while (i<=sqrt((double)x) && retVal==1)
{
if (x\%i==0) retVal=0;
i++;
Ответ:
Код и пример вывода в прикрепленных файлах ниже.
Объяснение:
2) y=x²+5
x=5 y=25+5=30
x=7 y= 49+5=54
x=9 y=81+5=86 ответ 2)