Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63190 李远扬 打印杨辉三角 C++ Runtime Error 2 MS 272 KB 335 2024-01-06 14:11:01

Tests(0/15):


Code:

#include <iostream> using namespace std; int main (){ int n; cin>>n; int a[21][21]; for(int i=0;i<21;i++){ for(int j=0;j<21;j++){ a[i][j]=0; } } a[0][0]=1; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ a[i][j]=a[i-1][j]+a[i-1][j-1]; cout<<a[i][j]; } cout<<endl; } return 0; }


Run Info:

Runtime Error:Segmentation fault