Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
34302 yangyuezheng 菲波那契数 C++ Compile Error 0 MS 0 KB 267 2023-12-17 19:19:37

Tests(0/0):


#include<iostream> #include<iomanip> using namespace std; int main(){ int k; cin>>k; int a1=1,a2=1,a3=0,i=2; if(k== or k==2) cout<<1; else{ do{ a3=a1+a2; a1=a2; a2=a3; i++; }while(i<k); cout<<a3; }


Judgement Protocol: