Laitofai

57

Apr 8th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. //57
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int n;
  10.     cin >> n;
  11.     int a[n];
  12.     for(int i = 0; i < n; i++){
  13.         cin >> a[i];
  14.     }
  15.     for(int i = 0; i < n; i++){
  16.         if((a[i] / 1000 + (a[i] % 1000) / 100) == (((a[i] % 100) / 10) + (a[i] % 10))){
  17.             cout << a[i] << " ";
  18.         }
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment