Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158916 余建成 22第n项的数 C++ Compile Error 0 MS 0 KB 248 2026-08-23 13:28:34

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int x[100]={},n; cin>>n; for(int i=0;i<4;i++){ cin>>x[i]; } int a=x[1]-x[0]; if(x[3]-x[2]==a)cout<<x[0]+[n-1]*a; else{ cout<<x[0]*pow(x[2]/x[1],n-i); } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:31: error: expected ',' before '-' token
  if(x[3]-x[2]==a)cout<' and 'int')
Main.cc:12:30: error: 'i' was not declared in this scope
   cout<