Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164561 屠思宇 【基础题】菲波拉契数列 C++ Accepted 1 MS 260 KB 358 2026-11-05 20:11:43

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a=0,b=1,c; for (int i=0;i<=20;i++){ if (i==0){ cout<<a; } else if (i==1){ cout<<" "<<b; } else{ c=a+b; cout<<" "<<c; a=b; b=c; } } return 0; }