Advertisement
TwiNNeR

1-2+3-4+5... (chisto)

Dec 10th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.10 KB | None | 0 0
  1. int n,zbir;
  2.  
  3. for(int i=1;i<=n;i++) {
  4. if(i%2==0) zbir=zbir-i;
  5. else zbir=zbir+i;
  6. }
  7.  
  8. cout<<zbir;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement