Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. int sumBalance(int arr_size, int* arr) {
  2. int i;
  3. int j;
  4. int sum1=0;
  5. int sum2=0;
  6. for(i=0;i<arr_size;i++)
  7. {
  8. if(i==0&&arr_size==1)
  9. {
  10. return 1;
  11. }
  12. else if(i==0)
  13. {
  14. sum1=0;
  15. for(j=i+1;j<arr_size;j++)
  16. {
  17. sum2= sum2+ a[j];
  18. }
  19. if(sum1==sum2)
  20. return 1;
  21. else
  22. {
  23. sum1=0;
  24. sum2=0;
  25. continue;
  26. }
  27. }
  28. else if(i==arr_size-1)
  29. {
  30. sum2=0;
  31. for(j=0;j<arr_size-2;j++)
  32. {
  33. sum1= sum1+ a[j];
  34. }
  35. if(sum1==sum2)
  36. return 1;
  37. else
  38. {
  39. sum1=0;
  40. sum2=0;
  41. continue;
  42. }
  43. }
  44. for(j=0;)
  45.  
  46.  
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement