Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n, max=0, min=99999, broj, predhoden, razlika;
- scanf("%d", &n ) ;
- if( n==0 ) {
- printf("0\n"); // prevremen kraj
- return 0;
- }
- scanf("%d", &broj);
- if( n==1 ) { // eden broj
- printf("%d\n", &broj); // samo nego go printame
- return 0; // prevremen kraj
- }
- predhoden=broj;
- while( n-- ){ // ili --n
- scanf("%d", &broj); // od vtoriot faktichki pochnuvame tuka
- razlika=broj-predhoden;
- if( max < razlika ) // ili max <= razlika
- {
- max = razlika;
- }
- predhoden=broj;
- }
- printf("%d\n", &max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement