Programming Logic & ICPC
Subscribe To
Posts
Atom
Posts
Comments
Atom
Comments
Saturday, June 6, 2015
LightOJ - 1182 - Parity
#include <bits/stdc++.h>
using
namespace
std
;
int
main
(
)
{
int
t, n, cs
=
0
;
cin
>>
t
;
while
(
t
--
)
{
int
m
=
0
;
cin
>>
n
;
while
(
n
)
{
if
(
n
%
2
)
m
++
;
n
/
=
2
;
}
cout
<<
"Case "
<<
++
cs
<<
": "
;
puts
(
(
m
%
2
)
?
"odd"
:
"even"
)
;
}
return
0
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment