Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int cstn (int n)
- {
- int k = n, sdn = 0;
- while (k) {
- sdn = sdn * 10 + k % 10;
- k /= 10;
- }
- return sdn == n;
- }
- int cslp(int n)
- {
- int sum = 0, kt = 0;
- while (n) {
- sum += n % 10;
- kt = n % 10 == 6 ? 1 : kt;
- n /= 10;
- }
- return kt && sum % 10 == 8;
- }
- int main()
- {
- int a, b;
- scanf("%d %d", &a, &b);
- for (int i = (a < b ? a : b); i <= (a < b ? b : a); i++) {
- cstn(i) && cslp(i) ? printf("%d ", i) : 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement