9 条题解
-
2许栋轶 LV 10 @ 2022-10-26 20:00:37
#include <iostream> #include <stack> #include <cmath> #include <vector> #include <string.h> #include <queue> #include <stdio.h> #include <iomanip> #include <cstdio> #include <algorithm> #define int long long using namespace std; const int N = 1e2 + 10; const int INF = 0x3f3f3f3f; int a[N]; signed main() { int n, maxn = -INF, ans = 0; cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; maxn = max(maxn, a[i]); ans += a[i]; } for(int i = 1; i <= n; i++) { if(a[i] == maxn) { ans -= maxn; } } cout << ans << endl; return 0; }
-
12023-4-2 19:46:35@
#include<iostream> #include<string.h> using namespace std; int a[100]; int main() { int i,maxn=-1000000,N,x=0; cin >> N; for(i = 0;i < N;i++) { cin >> a[i];
if(a[i]>maxn)maxn=a[i]; x+=a[i]; } for(i=0;i<N;i++) { if(a[i]==maxn)x-=maxn; } cout << x << endl; return 0;
}
-
02024-11-10 11:48:18@
jjjjjjjjjj
-
02024-10-30 20:19:28@
#include<iostream> #include<string.h> using namespace std; int a[100]; int main() { int i,maxn=-1000000,N,x=0; cin >> N; for(i = 0;i < N;i++) { cin >> a[i]; if(a[i]>maxn)maxn=a[i]; x+=a[i]; } for(i=0;i<N;i++) { if(a[i]==maxn)x-=maxn; } cout << x << endl; return 0; }
-
02024-10-20 18:53:04@
#include<iostream> using namespace std; int a[2000000],n,k,d=1; int main(){
cin>>n; for (int i=1;i<=n;i++){ cin>>a[i]; } for (int i;i<=n;i++) if(a[i] > d){ d=a[i]; } cout<<d; return 0;
}
-
02022-3-13 21:03:09@
#include<iostream> #include<string.h> using namespace std; int a[100]; int main() { int i,maxn=-1000000,N,x=0; cin >> N; for(i = 0;i < N;i++) { cin >> a[i]; if(a[i]>maxn)maxn=a[i]; x+=a[i]; } for(i=0;i<N;i++) { if(a[i]==maxn)x-=maxn; } cout << x << endl; return 0; }
-
02022-1-25 17:06:16@
#include<iostream> #include<string.h> using namespace std; int a[100]; int main() { int i,maxn=-1000000,N,x=0; cin >> N; for(i = 0;i < N;i++) { cin >> a[i]; if(a[i]>maxn)maxn=a[i]; x+=a[i]; } for(i=0;i<N;i++) { if(a[i]==maxn)x-=maxn; } cout << x << endl; return 0; }
-
-22022-7-11 9:11:13@
//dev c++[[990.cpp]]*******
//dev c++[top fanil]]******
//dev c++*www.temege.com
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <queue>
#include <stack>
#include <vector>
#include <iomanip>
#include <string.h>
#include <algorithm>
using namespace std;
#define LL long long
const int N=1e6+10;
const int INF=0x3f3f3f3f;
int a[110];
int main()
{
int n,maxx=-999999; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; maxx=max(maxx,a[i]); } int sum=0; for(int i=1;i<=n;i++) { if(maxx!=a[i]) { sum+=a[i]; } } cout<<sum<<endl; return 0;
}
-
-42022-7-10 18:37:59@
#include<stdio.h> #include<iostream> using namespace std; #define LL long long const int N=1e6+10; const int INF=0x3f3f3f3f; int a[N]; int main() { int n,sum=0; int maxx=-10000; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; maxx=maxx>a[i]?maxx:a[i]; sum+=a[i]; } for(int i=1;i<=n;i++) if(a[i]==maxx) sum-=maxx; cout<<sum<<endl; }
- 1
信息
- ID
- 994
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 923
- 已通过
- 303
- 上传者