Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- // Author: Sam Sampaio
- int func(int *pointer, size_t tam) {
- int i, count = 1, size = 0;
- for(i=0; i < tam-1; i++) {
- if(pointer[i] < pointer[i+1]) {
- count++;
- if(size < count)
- size = count;
- } else
- count = 1;
- }
- return size;
- }
- int main(void){
- int array[16] = {1,2,3,4,5,1,1,1,2,3,4,16,17,18,18,20};
- printf("%d\n", func(array,16));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement