Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61083 戴文博 找路径 C++ Compile Error 0 MS 0 KB 290 2023-11-30 16:16:43

Tests(0/0):


Code:

#include<bits/stdc++.h> using namesapace std; int main(){ int m,n; cin>>m>>n; int a[m+1][n+1]; int a[1][1]=1; for(int i=1;i<=m;i++){ for(int j=2;j<=n;j++){ a[i][j]=a[i-1][j]+a[i][j-1]; } } cout<<a[m][n]; return 0; }


Run Info:

Main.cc:2:7: error: expected nested-name-specifier before 'namesapace'
 using namesapace std;
       ^
Main.cc: In function 'int main()':
Main.cc:5:5: error: 'cin' was not declared in this scope
     cin>>m>>n;
     ^
Main.cc:5:5: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:74:0,
                 from Main.cc:1:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:7:15: error: conflicting declaration 'int a [1][1]'
     int a[1][1]=1;
               ^
Main.cc:6:9: note: previous declaration as 'int a [(m + 1)][(n + 1)]'
     int a[m+1][n+1];
         ^
Main.cc:13:5: error: 'cout' was not declared in this scope
     cout<