Advertisement
raisul82

UVa 10079

Oct 11th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i;
  5. long int pice=1,j;
  6. while(scanf("%ld",&j)==1)
  7. {
  8. if(j>=0)
  9. {
  10.  
  11. for(i=1; i<=j; i++)
  12. {
  13. pice=pice+i;
  14. }
  15. printf("%ld\n",pice);
  16. pice=1;
  17.  
  18. }
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement