Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int A[105],B[105];
- int main()
- {
- int m,i,p,q,n=0;
- cin>>m;
- for (i=0; i<m; i++)
- cin>>A[i];
- cin>>p>>q;
- for (i=0; i<m; i++)
- {
- if (A[i]>p && A[i]<q)
- {
- n++;
- B[n-1]=A[i];
- }
- }
- if (n == 0)
- cout<<"Nu exista numere";
- else
- {
- cout<<"B: (";
- for (i=0; i<n; i++)
- if (i == n-1)
- cout<<B[i];
- else
- cout<<B[i]<<",";
- cout<<")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement