等差数列公式an=a1+(n-1)d; #include<stdio.h> int main() { int a,b,c; int d; scanf("%d%d",&a,&b); d=b-a; c=a+2d; printf("%d",c); }