鲁班创客OJ
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
Login
1166: 等差数列
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:40
Solved:31
Submit
Submit Record
Statistics
ShowOff!
Description
给出等差数列的前两项a1,a2,计算第n项是多少
Input
等差数列前两项和n
Output
第n项
Sample Input
Copy
2 4 3
Sample Output
Copy
6
HINT
an=a1+(n−1)d
d=a2-a1
Source/Category
基础
输出
基本运算
Submit
Submit Record
Statistics
ShowOff!