Sunday, March 20, 2016

URI 1080 - Highest and Position

#include<stdio.h>
int main()
{
    long long i , x[100];
    int count=0;
    for(i=0; i<100; i++){
        scanf("%lld",&x[i]);
        if(x[i]>=x[count])
            count=i;
    }
    printf("%lld\n%d\n",x[count],count+1);
    return 0;
}

No comments:

Post a Comment