1) (первые 2 скриншота)
#include
using std::cout;
using std::endl;
#include
using std::rand;
using std::srand;
#include
using std::time;
int main()
{
int a[10];
srand(time(0));
for(int i = 0; i < 10; i++)
{
a[i] = rand() % 101;
cout << a[i] << ' ';<br> }
cout << endl << endl;<br>
for(int i = 0; i < 10; i++)
{
if(a[i] % 3 == 0 && a[i] > 13)
{
cout << a[i] << ' ';<br> }
}
cout << endl;<br>
return 0;
}
2)
#include
using std::cout;
using std::endl;
int main()
{
double a[10] = { 1.2, 0.0, -5.8, -0.4, 10.5, 14.6, -6.3, -8.8, -4.1, 0.0 };
int A = 0, B = 3;
for(int i = 0; i < 10; i++)
{
cout << a[i] << ' ';<br> if(a[i] < 0.0)
{
a[i] += a[A];
}
else if(a[i] == 0)
{
a[i] -= B;
}
}
cout << "\n\na(index) = " << A << ", b = " << B << "\n\n";<br>
for(int i = 0; i < 10; i++)
{
cout << a[i] << ' ';<br> }
cout << endl;<br>
return 0;
}