fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. short ile;
  6. char w; long long int l[1000], c;
  7.  
  8. int main()
  9. {
  10. cin >> ile;
  11. for (int i=1; i<=ile; i++)
  12. {
  13. cin >> l[i];
  14. }
  15. cin >> w; cin >> c;
  16. if (w=='<')
  17. {
  18. for (int i=1; i<=ile; i++)
  19. {
  20. if (l[i]<c)
  21. cout << l[i] << endl;
  22. }
  23. cout << endl;
  24. }
  25. else if (w=='>')
  26. {
  27. for (int i=1; i<=ile; i++)
  28. {
  29. if (l[i]>c)
  30. cout << l[i] << endl;
  31. }
  32. cout << endl;
  33. }
  34. return 0;
  35. }
Success #stdin #stdout 0s 3480KB
stdin
5
2
7
0
6
2
< 3
stdout
2
0
2