WA了!
查看原帖
WA了!
1368800
违规用户名1368800楼主2024/7/21 18:05
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d=2,e,f;
	cin>>a>>b>>c;
	f=a+b;
	if(a>b)
	{
		e=a-b;
	}
	else if(a<b)
	{
		e=b-a;
	}
	while(d<c)
	{
		b=b+e;
		f=f+b;
		d++;
	}
	cout<<f;
	return 0;
}
2024/7/21 18:05
加载中...