7 条题解
-
1512224邵雨轩 (12224邵雨轩) LV 8 @ 2022-01-07 16:13:02
#include <iostream>
using namespace std;
int main()
{
int a1,a2,n,s;
cin>>a1>>a2>>n;
s=a1+(a2-a1)*(n-1);
cout<<s<<endl;
return 0;
}
留个赞啊谢谢 -
32021-11-21 21:27:17@
#include <iostream>
using namespace std;
int main()
{
int a1,a2,n,s;
cin>>a1>>a2>>n;
s=a1+(a2-a1)*(n-1);
cout<<s;
return 0;
} -
22021-11-01 16:31:05@
include<iostream>
#include<iomanip>
#include<cmath>
#include<bits/stdc++.h>
#include<cstdio>
#include <stdio.h>
int main()
{
int a1,a2,n,d,last; //d为公差,last为末项,n为项数
scanf("%d %d %d",&a1,&a2,&n);
d = a2-a1;
last = a1 + d*(n-1);
printf("%d\n",last);return 0;
} -
12024-08-18 17:42:18@
#include<iostream> using namespace std; int main(){ long long a1, a2, n; cin >> a1 >> a2 >> n; cout << a1+(n-1)*(a2-a1); return 0; }
-
12021-12-20 09:48:06@
#include<iostream>
using namespace std;
int main()
{
int a1,a2,n,d,last;
cin>>a1>>a2>>n;
d=a2-a1;
last=a1+d*(n-1);
cout<<last;
return 0;
} -
12021-11-23 22:28:15@
#include<iostream>
#include<iomanip>
#include<cmath>
#include<ctime>
using namespace std;
int main()
{
int a2,a1,n,X;
cin>>a1>>a2>>n;
X=a1+(a2-a1)*(n-1);
cout<<X;
return 0;
} -
12021-11-06 20:50:17@
include<iostream>
#include<iomanip>
#include<cmath>
#include<bits/stdc++.h>
#include<cstdio>
#include <stdio.h>
int main()
{
int a1,a2,n,d,last;
scanf("%d %d %d",&a1,&a2,&n);
d = a2-a1;
last = a1 + d*(n-1);
printf("%d\n",last);return 0;
}
- 1
信息
- ID
- 2327
- 难度
- 1
- 分类
- (无)
- 标签
- 递交数
- 152
- 已通过
- 109
- 通过率
- 72%
- 被复制
- 3
- 上传者