Maximum - Easy Problems - Solution to Toph.co Online Judge Problem

Maximum

Limits 1s, 512 MB

Given N numbers, find the one that is of the highest value and print it.

Input

The first line of the input will contain N (0 < N < 100).
The following line will contain N integers, each between 1 and 1000.

Output

Print the maximum.

#include<stdio.h>

int main()
{
    int n,s[100],i,max=0;
    scanf("%d", &n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
        if(s[i]>max)
            max=s[i];
    }

    printf("%d",max);

}