为什么
查看原帖
为什么
1416426
tengyuxuan楼主2024/12/11 19:40

0分:

#include <bits/stdc++.h>
using namespace std;
long long he,nx,d,xs;
int main()
{
    cin>>he>>nx>>xs;
    d=nx-he;
    cout<<(xs*he+xs*(xs-1)*d)/2;
    return 0;
}

100分:

#include <bits/stdc++.h>
using namespace std;
long long he,nx,d,xs;
int main()
{
    cin>>he>>nx>>xs;
    d=nx-he;
    cout<<(xs*he+xs*(xs-1)*d/2);
    return 0;
}
2024/12/11 19:40
加载中...