#include<bits/stdc++.h>
using namespace std;
int n;
int a[101],maxn=-1000001;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
		if(maxn<*(a+i)){
			maxn=*(a+i);
		}
	}
	int sumn=0;
	for(int i=0;i<n;i++){
		if(*(a+i)!=maxn) sumn+=*(a+i);
	}
	printf("%d",sumn);
	return 0;
}

0 comments

No comments so far...

Information

ID
232
Time
1000ms
Memory
256MiB
Difficulty
8
Tags
# Submissions
219
Accepted
31
Uploaded By