#include <iostream>
#include <vector>
using namespace std;
int main()
{
int a[10] = { -7, 17, 69, 25, 88, 14, 84, 36, -4, 75 };
int b[10] = { 16, -30, 11, 39, 15, -36, 12, 6, -30, 5 };
int c[10] = { -19, 35, -6, 15, -9, 13, 8, 12, -33, 42 };
//Вариант, когда размер y равен 10:
int y[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
for (int i = 0; i < 10; i++)
{
if (c[i] > 0)
{
y[i] = a[i] - b[i];
}
}
for (int i = 0; i < 10; i++)
{
cout << y[i] << " ";
}
cout << endl;
//Вариант, когда размер y неизвестен:
vector<int> y2;
int counter = 0;
for (int i = 0; i < 10; i++)
{
if (c[i] > 0)
{
y2.push_back(a[i] - b[i]);
counter++;
}
}
for (int i = 0; i < counter; i++)
{
cout << y2[i] << " ";
}
}