Advertisement
CotoiRares

4/29

Jan 13th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int A[105],B[105];
  5. int main()
  6. {
  7. int m,i,p,q,n=0;
  8. cin>>m;
  9. for (i=0; i<m; i++)
  10. cin>>A[i];
  11. cin>>p>>q;
  12. for (i=0; i<m; i++)
  13. {
  14. if (A[i]>p && A[i]<q)
  15. {
  16. n++;
  17. B[n-1]=A[i];
  18. }
  19. }
  20. if (n == 0)
  21. cout<<"Nu exista numere";
  22. else
  23. {
  24. cout<<"B: (";
  25. for (i=0; i<n; i++)
  26.  
  27. if (i == n-1)
  28. cout<<B[i];
  29. else
  30. cout<<B[i]<<",";
  31.  
  32.  
  33. cout<<")";
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement