Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99546 | 蔡佳轩 | 斐波那契数列 | C++ | Compile Error | 0 MS | 0 KB | 592 | 2024-11-30 11:35:53 |
#include <iostream> using namespace std; int main(){ int a=1,b=1,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; }#include <iostream> using namespace std; int main(){ int a=1,b=1,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; }
Main.cc:18:2: error: stray '#' in program }#include ^ Main.cc:18:3: error: 'include' does not name a type }#include ^ Main.cc: In function 'int main()': Main.cc:20:5: error: redefinition of 'int main()' int main(){ ^ Main.cc:3:5: note: 'int main()' previously defined here int main(){ ^