Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // Name : HelloWorld.cpp
- // Author : smalinux
- // Version :
- // Copyright : Your copyright notice
- // Description : Hello World in C++, Ansi-style
- //============================================================================
- #include <iostream>
- #include <string>
- #include<iomanip>
- using namespace std;
- int main() {
- // ----------------------------------------------------------------------
- unsigned int N = 0;
- int lowest = 0;
- int lowestPositon = 0;
- int arr[998];
- cin >> N;
- // - Insertion
- if(N >= 2 && N <= 1000) {
- for(int i = 0; i < N; i++)
- cin >> arr[i];
- // - Output
- lowest = arr[0];
- for(int i = 0; i < N; i++) {
- if(arr[i] < lowest) {
- lowest = arr[i];
- lowestPositon = i;
- }
- }
- if(lowest >= -1e5 && lowest <= 1e5)
- cout << lowest << " " << ++lowestPositon;
- }
- // ----------------------------------------------------------------------
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement