Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
72359 任斌 斐波那契数列 C++ Compile Error 0 MS 0 KB 263 2024-05-05 09:41:37

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int k,a=1,b=1,temp; cin>>k; if(k==1) cout<<a<<endl; else if(k==2) cout<<b<<endl; else{ for(int i=3;i<=k;i++){ temp=a+b; a=b; b=temp; } cout<<b<<endl;2 } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:18:2: error: expected ';' before '}' token
  }
  ^
Main.cc:18:2: warning: statement has no effect [-Wunused-value]