daily pastebin goal
35%
SHARE
TWEET

vovo.c

a guest May 16th, 2018 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.   int N, S, I=0, v1, S2, temp;
  6.   scanf ("%d%d", &N, &S);
  7.   S2=S;
  8.   while(I < N){
  9.       scanf("%d", &v1);
  10.       S2 += v1;  
  11.       if(S2<S){
  12.           temp=S2;
  13.       }
  14.       if(S2>S){
  15.           S=S2;
  16.       }
  17.       I++;
  18.   }
  19.   printf("%d\n", temp);
  20.   return 0;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top