Advertisement
Matqux

A2

Oct 30th, 2019
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int min;
  6.     int max;
  7.  
  8.     scanf("%d %d", &min, &max);
  9.  
  10.     for (int i = min; i <= max; i++)
  11.     {
  12.         int egyes;
  13.         int tizes;
  14.         int szazas;
  15.  
  16.         egyes = i % 10;
  17.         tizes = ((i % 100) - egyes) / 10;
  18.         szazas = (((i % 1000) - tizes) - egyes) / 100;
  19.  
  20.         if ((szazas - tizes) == (tizes - egyes))
  21.         {
  22.             printf("%d\n", i);
  23.         }
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement