Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int N;
- int diff = 0;
- int max = 0;
- int T = 1001;
- int count = 0;
- do {
- scanf("%d", &N);
- if(N != 0)
- count++;
- if(N > T)
- diff = diff + N - T;
- else
- if(diff > max) {
- max = diff;
- diff = 0;
- }
- T = N;
- } while(N != 0)
- printf("Recieved %d numbers\nThe biggest difference: %d", count, max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement