Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77579 梁敖铭 火车上的人数 C++ Compile Error 0 MS 0 KB 354 2024-06-12 21:06:20

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a,n,m,x,d[16]={0},down[16]={0},up[16]={0}; cin>>a>>n>>m>>x; d[1]=d[2]=a; up[1]=a; for(int i=0;i<m;i++){ up[2]=down[2]=i; for(int j=3;j<n;j++){ up[j]=up[j-1]+up[j-2]; down[j]=up[j-1]; d[j]=d[j-1]+up[j-2]; } if(d[n-1]==m){ cout<<d[x]; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:19:13: error: expected '}' at end of input
   return 0; } 
             ^