URI / BEE CROWD 1080 - Highest and Position Solution in C,C++,Python | URI - BEECROWD - BEE 1080 Solution in C,C++,Python
beecrowd | 1080
Highest and Position
Adapted by Neilor Tonin, URI Brazil
Timelimit: 1Adapted by Neilor Tonin, URI Brazil
Read 100 integer numbers. Print the highest read value and the input position.
Input
The input file contains 100 distinct positive integer numbers.
Output
Print the highest number read and the input position of this value, according to the given example.
Input Sample | Output Sample |
2 | 34565 |
URI / BEE CROWD 1080 - Highest and Position Solution in C,C++,Python | URI - BEECROWD - BEE 1080 Solution in C,C++,Python
Demonstration:
URI / BEE 1080 Solution in C :
URI / BEECROWD Online Judge 1080 Solve in C : |
#include<stdio.h>
int main()
{
int i,j = 0,p,arr[100];
for (i = 0;i < 100;i++){
scanf("%d", &arr[i]);
}
for(i = 0;i < 100;i++){
if(arr[i] > j){
j = arr[i];
p = i+1;
}
}
printf("%d\n", j);
printf("%d\n", p);
return 0;
}
0 Response to URI / BEE CROWD 1080 - Highest and Position Solution in C,C++,Python | URI - BEECROWD - BEE 1080 Solution in C,C++,Python
Post a Comment