-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1002.cpp
More file actions
35 lines (35 loc) · 757 Bytes
/
Copy path1002.cpp
File metadata and controls
35 lines (35 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <algorithm>
using namespace std;
// Á½ÖØÑ»·¿É¹ý
int main()
{
int data[100][1000];
int m;
cin >> m;
for (int i = 0;i < m;i++)
{
cin >> data[i][0];
for (int j = 0;j < data[i][0];j++)
{
cin >> data[i][j + 1];
}
int mini = data[i][1];
for (int j = 1;j <= data[i][0];j++)
{
if (data[i][j] < mini)
{
mini = data[i][j];
}
}
int secmini = INT32_MAX;
for (int j = 1;j <= data[i][0];j++)
{
if (data[i][j] > mini && data[i][j] < secmini)
{
secmini = data[i][j];
}
}
cout << secmini << endl;
}
}