| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156207 | 陈骏睿 | 打印貌似杨辉三角 | C++ | Compile Error | 0 MS | 0 KB | 634 | 2026-06-27 10:17:08 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a[31][31]={0}; cin>>n; a[1][1]=1; for(int i=2;i<=n;i++){ a[i-1][0]=a[i-1][i]=1 for(int j=1;j<=i;j++){ a[i][j]=a[i-1][j-1]+a[i-1][j]; } } for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ if(i==j)cout<<a[i][j]<<endl; else cout<<a[i][j]<<' '; } } return 0; }
Main.cc: In function 'int main()':
Main.cc:13:9: error: expected ';' before 'for'
for(int j=1;j<=i;j++){
^
Main.cc:13:21: error: 'j' was not declared in this scope
for(int j=1;j<=i;j++){
^