Untitled

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