等差数列求和为什么出小数
哪个大佬看看哪里有问题#include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,c,x,y,s;
cin>>a>>b>>c;
x=b-a;
y=((c-a)/x)+1;
s=(a+c)*y/2;
cout<<s;
return 0;
}
2022-07-14 20:55
2022-07-14 20:58
2022-07-14 22:50
2022-07-15 17:25
2022-07-15 17:27