Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
spoj BCPALIN
SUBMITTED BY:
Guest
DATE:
Feb. 16, 2014, 9:25 a.m.
FORMAT:
C++
SIZE:
661 Bytes
Raw
Download
Tweet
HITS:
956
Go to comments
Report
//Haha TTpro
//BCPALIN
//http://www.spoj.com/PTIT/problems/BCPALIN/
#include
<iostream>
using
namespace
std
;
bool
doixung
(
int
A
);
int
main
()
{
int
A
;
int
t
;
cin
>>
t
;
for
(
int
i
=
1
;
i
<=
t
;
i
++
)
{
cin
>>
A
;
if
(
doixung
(
A
))
cout
<<
"YES"
;
else
cout
<<
"NO"
;
cout
<<
endl
;
}
return
0
;
}
bool
doixung
(
int
A
)
{
int
a
=
A
;
int
b
=
0
;
// so sau khi tach
int
x
;
// tach so
while
(
a
!=
0
)
{
b
=
b
*
10
;
x
=
a
%
10
;
a
=
a
/
10
;
b
=
b
+
x
;
}
if
(
A
==
b
)
return
true
;
return
false
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus