fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7. int n, x;
  8. cin >> n >> x;
  9.  
  10. while(n--)
  11. {
  12. int a;
  13. cin >> a;
  14.  
  15. if(a < x)
  16. cout << a << " ";
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4788KB
stdin
10 5
1 10 4 9 2 3 8 5 7 6
stdout
1 4 2 3