Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream cin("input.txt");
- int n;
- cin>>n;
- int a[n];
- for(int i = 0; i < n; i++)
- cin>>a[i];
- int m;
- cin>>m;
- for(int j = 0; j < m; j++)
- {
- char c;
- cin>>c;
- int cur;
- cin>>cur;
- if (c == '<')
- {
- for(int i = 0; i < n; i++)
- if(a[i] < cur)
- cout<<a[i]<<' ';
- cout<<'\n';
- }
- else if (c == '>')
- {
- for(int i = 0; i < n; i++)
- if(a[i] > cur)
- cout<<a[i]<<' ';
- cout<<'\n';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement