Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121556 罗迎甲 22不与最大数相同的数字之和 C++ Accepted 1 MS 272 KB 582 2025-06-07 16:47:23

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n1[100]={0}; int n,max1=0,a1=0; cin>>n; for(int w=0;w<n;w++){ cin>>n1[w]; max1=n1[0]; } for(int w=0;w<n;w++){ if(max1<n1[w]) max1=n1[w]; } for(int w=0;w<n;w++){ if(n1[w]!=max1) a1+=n1[w]; } cout<<a1<<endl; return 0; }