Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120116 何辰熠 22第n项的数 C++ Wrong Answer 1 MS 276 KB 328 2025-05-24 10:23:38

Tests(1/5):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a,b[4],c1,c2; float x; cin>>a; for(int i=0;i<4;i++) { cin>>b[i]; } c1=b[1]-b[0]; c2=b[3]-b[2]; x=b[1]/b[0]; if(c1==c2) { cout<<b[0]+c1*(a-1); } else { cout<<int(b[1]*pow(x,(a-1))); } return 0; }


Run Info:

------Input------
5 1 2 4 8
------Answer-----
16
------Your output-----
32