Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int M[n-1];
- for(int i = 0; i <= n-1; i++){
- cin >> M[i];
- }
- int maks = 1, maz = 9999999, msum = 0, minsum = 0;
- for(int i = 0; i < n; i++){
- if(maks < M[i]) maks = M[i];
- if(maz > M[i]) maz = M[i];
- }
- for(int i = 0; i < n; i++){ //sumuoja didziausius ir maziausius
- if(M[i] == maks) msum++;
- if(M[i] == maz) minsum++;
- }
- //cout << maks << endl << maz << endl;
- for(int i = 0; i < n; i++){
- if(M[i] != maks and M[i] != maz) cout << M[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement