文章
72
粉丝
142
获赞
5
访问
58.5k
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 105;
int number[maxn];
int a[maxn];
int main() {
int n;
while (cin>>n) {
for (int i = 0; i < n;i++) {
cin >> number[i];
a[i] = number[i];
}
sort(number, number + n);
int number1 = number[0];
int number2 = number[n-1];
for (int i = 0; i < n;i++) {
if (a[i]==number1||a[i]==number2) {
&nbs...
登录后发布评论
数字相同的时候会出问题