Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
99549 刘佳宇 斐波那契数列 C++ Compile Error 0 MS 0 KB 279 2024-11-30 11:36:00

Tests(0/0):


Code:

##include<iostream> using namespace std; int main(){ int a=1; int b=1; int c; int k; cin>>k; for(int i=1;i<=k;i++){ if(i==1||i==2){ c=1; } else{ c=a+b; a=b; b=c; } } cout<<c; }


Run Info:

Main.cc:1:1: error: stray '##' in program
 ##include
 ^
Main.cc:1:3: error: 'include' does not name a type
 ##include
   ^
Main.cc: In function 'int main()':
Main.cc:8:5: error: 'cin' was not declared in this scope
     cin>>k;
     ^
Main.cc:19:2: error: 'cout' was not declared in this scope
  cout<