Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
924 曾浩森 PELL数列 C++ Compile Error 0 MS 0 KB 425 2023-05-27 15:15:24

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int b,c,k[1001],max=0; long long a[100000] cin>>c; for(int i=0;i<c;i++){ cin>>k[i]; if(max<k[i]){ max=k[i]; } } a[1]=1; a[2]=2; for(int i=3;i<=max;i++){ a[i]=a[i-1]*2+a[i-2]; } for(int i=0;i<c;i++){ cout<<a[k[i]]%32767<<endl; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:5: error: expected initializer before 'cin'
     cin>>c;
     ^
Main.cc:14:5: error: 'a' was not declared in this scope
     a[1]=1;
     ^
Main.cc:4:9: warning: unused variable 'b' [-Wunused-variable]
     int b,c,k[1001],max=0;
         ^