ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#213020 | #4. 爬楼梯 | wintan | Compile Error | / | / | C++ | 246b | 2024-11-02 19:28:22 | 2024-11-02 19:28:24 |
answer
#include<cstdio>
using namespace std;
int n,a[50];
int main(){
//freopen ("4.in","r",stdin);
//freopen("4.out","w",stdout);
cin >>n;
a[1]=1,a[2]=2;
for(int i=3;i<=n;i++){
a[i]=a[i-1]+a[i-2];
}
printf("%d",a[n]);
return 0;
}
Details
answer.code: In function 'int main()': answer.code:7:2: error: 'cin' was not declared in this scope cin >>n;\x0d ^