mhdew

1149 URI

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