1 solutions

  • 0
    @ 2023-1-21 19:43:29
    #include<bits/stdc++.h>
    using namespace std;
    int a[110];
    int main()
    {
    	int n, ma = 0, g = 0;
    	cin >> n;
    	for (int i = 0; i < n; i++){
    		cin >> a[i];
    			if(a[i] > a[ma])
    				a[ma] = a[i];
    	}
    	for(int i = 0; i < n; i++)
    		if(a[i] == a[ma])
    			g++;
    	sort(a,a+n,greater<int>());//内置类型的由大到小排序
    	for(int i = 0; i < n; i++){
    		cout << a[i+g];
    		break;
    	}
    	 	return 0;
    }
    
    • 1

    Information

    ID
    1148
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    10
    Tags
    # Submissions
    4
    Accepted
    2
    Uploaded By