Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
266 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int const a = 10000;
	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;
}