1.
#include <iostream>
using namespace std;
int main()
{
int n, numara = 0, numara2 = 0, s = 0;
cin >> n;
for (int i = 1; numara < n; i++)
{
if (i % 2 == 0)
{
cout << i << " ";
numara++;
}
}
cout << endl;
for (int i = 1; numara2 < n; i++)
{
if (i % 2 == 0 && i % 3 == 0)
{
s += i;
numara2++;
}
}
cout << s;
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int n, numara = 0, numara2 = 0, p = 1;
cin >> n;
for (int i = 1; numara < n; i++)
{
if (i % 2 == 1)
{
cout << i << " ";
numara++;
}
}
cout << endl;
for (int i = 1; numara2 < n; i++)
{
if (i % 2 == 1 && i % 5 == 0)
{
p *= i;
numara2++;
}
}
cout << p;
return 0;
}