新手请指教!
我觉得这就是个求等差数列的和,所以只要用公式就能解决了。这只是个人意见,如有失误请多多包含!
#include <stdio.h>
#include <math.h>
int main()
{
int first, second, sum, count;
printf ("第一个数:");
scanf ("%d", &first);
printf ("第二个数:");
scanf ("%d", &second);
count = first-second;
count = abs(count)+1;
sum = (first+second)*count/2;
printf ("其间整数和是:%d", sum);
return 0;
}