Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92523 | 只因你太美(Ikun 真爱粉) | 22第n项的数 | C++ | Wrong Answer | 0 MS | 276 KB | 457 | 2024-10-05 16:37:40 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ double a,b,c,d; int n; cin>>n>>a>>b>>c>>d; if(b-a==c-b&&b-a==d-c){ cout<<a+(n-1)*(b-c); } if(b/a==c/b&&b/a==d/c){ cout<<a*pow(c/b,n-1); } return 0; }
------Input------
6 1 6 11 16
------Answer-----
26
------Your output-----
-24