SOLUTION OF URI 1149 URI SOLUTIONS No comments // 1149 (Mahmud_Jamil) BRUR // Summing Consecutive Integers #include <stdio.h>int main(){ int X, N, a,b=0; scanf("%d %d", &X, &N); while(N<=0) scanf("%d", &N); for(a=1; a<=N; a++) { b+=X; X++; } printf("%d\n",b); return 0;} Share This: Facebook Twitter Google+ Stumble Digg Email ThisBlogThis!Share to XShare to Facebook
0 comments:
Post a Comment