Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139789 郝王骏程 打印貌似杨辉三角 C++ Wrong Answer 1 MS 280 KB 731 2025-12-08 20:39:27

Tests(0/10):


Code:

#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 e,s=0; long long a[31][31]; a[1][1]=1; cin>>e; for(int i=0;i<=e;i++){ for(int j=0;j<=e;j++){ a[i][j]=1; } } for(int i=2;i<=e;i++){ for(int j=1;j<=e;j++){ a[i][j]=a[i-1][j-1]+a[i-1][j]; } } for(int i=1;i<=e;i++){ for(int j=1;j<=i;j++){ if(i==j) cout<<a[i][j]; else cout<<a[i][j]<<" "; } cout<<endl; } return 0; }


Run Info:

------Input------
28
------Answer-----
1 2 2 3 4 3 4 7 7 4 5 11 14 11 5 6 16 25 25 16 6 7 22 41 50 41 22 7 8 29 63 91 91 63 29 8 9 37 92 154 182 154 92 37 9 10 46 129 246 336 336 246 129 46 10 11 56 175 375 582 672 582 375 175 56 11 12 67 231 550 957 1254 1254 957 550 231 67 12 13 79 298 781 1507 2211 2508 2211 1507 781 298 79 13 14 92 377 1079 2288 3718 4719 4719 3718 2288 1079 377 92 14 15 106 469 1456 3367 6006 8437 9438 8437 6006 3367 1456 469 106 15 16 121 575 1925 4823 9373 14443 17875 17875 14443 9373 4823 1925 575 121 16 17 1
------Your output-----
1 2 2 3 4 4 4 7 8 8 5 11 15 16 16 6 16 26 31 32 32 7 22 42 57 63 64 64 8 29 64 99 120 127 128 128 9 37 93 163 219 247 255 256 256 10 46 130 256 382 466 502 511 512 512 11 56 176 386 638 848 968 1013 1023 1024 1024 12 67 232 562 1024 1486 1816 1981 2036 2047 2048 2048 13 79 299 794 1586 2510 3302 3797 4017 4083 4095 4096 4096 14 92 378 1093 2380 4096 5812 7099 7814 8100 8178 8191 8192 8192 15 106 470 1471 3473 6476 9908 12911 14913 15914 16278 16369 16383 16384 16384 16 121 576 1941 4944 9949 163