- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main() {
int n, a[1000], min, c=0;
cin>>n<<endl;
for(int i=0; i<n; i++){
cin>>a[i];
}
min=a[0];
for(int i=0; i<n; i++)
if(min>a[i])
min=a[i];
cout<<a[i];
system("pause");
return 0;
}
Given a sequence of numbers.Find minimum element from the given sequence.
Input data.
First line - n number,total amount of data in array.(1<=N=<1000)
Then all aray is inputed,all numbers are between -1000 and 1000.
Output data.
The minimum number from the sequence.
Sample input:
7
1 4 2 5 2 5 3
Sample output:
1
useint 20.09.2016 19:29 # −1
guest 20.09.2016 19:45 # −1
guest 20.09.2016 19:51 # −1
Bobik 21.09.2016 00:10 # −1
Мои треды про "где ошибка" интереснее.
huesto 21.09.2016 00:17 # −2
Bobik 21.09.2016 00:18 # −1
Steve_Brown 21.09.2016 10:55 # −1
Все соответствует.
CrashTesterAnusov 20.09.2016 19:56 # −68
guest 20.09.2016 20:00 # −2
CrashTesterAnusov 20.09.2016 21:06 # −66
gost 21.09.2016 19:00 # +2855
guestinho 21.09.2016 21:01 # 0