Advertisement
Raul_julian

1149

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