Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int tnghich(long);
- int main(void) {
- system ("cls");
- for (long i = 100000; i < 1000000; ++i)
- if (tnghich(i))
- cout << i << " ";
- cout << endl;
- cin.get();
- return 0;
- }
- int tnghich(long n) {
- long m1 = 0, m2 = n;
- n = (n < 0 ? -n : n);
- while (n) {
- m1 *= 10;
- m1 += +n % 10;
- n /= 10;
- }
- return (m1 == m2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement