Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5927 吴承熹 小明养猪的故事 C++ Wrong Answer 0 MS 260 KB 420 2024-12-21 10:13:21

Tests(0/1):


Code:

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


Run Info:

------Input------
17 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
------Answer-----
1 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
------Your output-----
1 4195088 5 5 8 8 13 13 21 21 34 34 55 55 89 89 144 144 233 233 377 377 610 610 987 987 1597 1597 2584 2584 4181 4181 6765 6765