@Monte-Cristo
2794 / 1380 / 30
Регистрация: 07.03.2009
Сообщений: 4,446
|
16.06.2009, 12:40
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| #include <iostream>
using namespace std;
bool Even(int x)
{
int count=0;
while(x!=0)
{
if (x&1) count++;
x >>= 1;
}
if (count%2==0) return true;
return false;
}
int main()
{
int x;
int mas[4] = {8, 9, 10, 11};
for (int i=0; i<4; i++)
if (Even(mas[i])) cout << mas[i] << "\t";
cout << endl;
cin.get(); // pause
return 0;
} |
|
0
|