Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- __int32_t get_max(__int32_t *arr, __int32_t nelem) {
- __int32_t max = 0,
- index;
- for( ; index < nelem; ++index )
- if( arr[index] > max )
- max = arr[ index ];
- return max;
- }
- int main(void) {
- __int32_t npipe,
- *arr_pipe = NULL;
- int i;
- scanf("%u", &npipe);
- arr_pipe = malloc(npipe * sizeof(__int32_t));
- for(i = 0 ; i < npipe; i++ )
- scanf("%u", &arr_pipe[i]);
- printf("%u", get_max(arr_pipe, npipe));
- free(arr_pipe);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement