Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
267 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main() 
{
	int const a = 100;
	int mas[a];
	int n, b = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		if (i % 2 == 0 && i != 0) {
			mas[i] = i;
			cout << mas[i] << " ";
			b += i;
		}

	}
	cout << b;
}