The smallest number - Competitive Programming

Competitive programming
Write a program that gets n 10 integers and writes the smallest value.

Input
Enter 10 integers separated by a space.
Output
Bring out the smallest number.


InputOutput
4 2 5 -1 4 6 2 10 9 3
-1



//snapkod.com
#include <iostream>
using namespace std;
int findSmallestElement(int arr[], int n){
   int temp = arr[0];
   for(int i=0; i<n; i++) {
      if(temp>arr[i]) {
         temp=arr[i];
      }
   }
   return temp;
}
int main() {
   int n=10;
   int arr[n-1];
   for(int i=0; i<n; i++){
      cin>>arr[i];
   }
   int smallest = findSmallestElement(arr, n);
   cout<<smallest;
   return 0;
}