Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92538 只因你太美(Ikun 真爱粉) 22第n项的数 C++ Compile Error 0 MS 0 KB 667 2024-10-05 16:52:33

Tests(0/0):


Code:

#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[4]; int n; cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; if(a[2]-a[1]==a[3]-a[2]&&a[3]-a[2]==a[4]-a[3]){ if(a[3]-a[2]!=0){ cout<<a+(n-1)*(a[3]-a[2]); return 0; } else{ cout<<a; return 0; } } if(a[3]/a[2]==a[4]/a[3]&&a[2]/a[1]==a[3]/a[2]){ cout<<a*pow(a[2]/a[1]*1.0,n-1); } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:33: error: invalid operands of types 'double [4]' and 'double' to binary 'operator+'
         cout<::__type {aka double}' to binary 'operator*'
         cout<