Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int n, n_old=0, counter = 0, max = 0;
- do {
- scanf(" %d", &n);
- if( n > n_old){
- ++counter;
- } else{
- if (max <= counter){ // If the max is smaller than the new sequence
- max = counter ; // Changes the new max to the counter
- counter = 1; // Updates the counter
- }
- }
- n_old = n; // Updates the old number for the next loop
- } while( n != 0 );
- printf("%d\n", max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement