Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112449 石晋骁 打印杨辉三角 C++ Compile Error 0 MS 0 KB 374 2025-03-09 14:31:47

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; long long a[31][31]; int main(){ int n; cin >> n; for(itn i = 1;i <= n;i++){ for(int j = 1;j <= i;j++){ if(j == 1){ a[i][j] = 1; }else if(i == j){ a[i][j] = 1; }else{ a[i] = a[i-1][j]+a[i-1][j-1]; } cout << a[i][j] << " "; } cout << endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:9: error: 'itn' was not declared in this scope
     for(itn i = 1;i  <= n;i++){
         ^
Main.cc:7:19: error: 'i' was not declared in this scope
     for(itn i = 1;i  <= n;i++){
                   ^