Time:06-11
CodePudding user response:
what do you want to do, Yang hui triangle?
what is it? Compile the problem? Run problem? Will you take to ask?
: ok, you make a copy of your code, too lazy to dozen
Quote: refer to the fifth floor qq_45798109 reply: : ok, you make a copy of your code, too lazy to dozen # include Int main () {Int a [10] [10]. int i,j; for(i=0; i<10; I++) for(j=0; j<10; J++) {if (i<1) a [I] [j]=1; Else if (j==I) a [I] [j]=1; Else a [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j]. } Printf (" % d ", a [I] [j]); return 0; }
# include & lt; stdio.h> #include Int main () {Int a [10] [10]={0}; for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {If (j==0 | | j==I) {A [I] [j]=1; } The else A [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j]. } } for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {Printf (" % d ", a [I] [j]); } printf("\n"); } return 0; }
output to cycle, you wrote just output a value of the output change should be ok, I put you in the first two if the merger, can the # include & lt; stdio.h> #include Int main () {Int a [10] [10]={0}; for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {If (j==0 | | j==I) {A [I] [j]=1; } The else A [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j]. } } for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {Printf (" % d ", a [I] [j]); } printf("\n"); } return 0; }
Quote: refer to the eighth floor qq_45798109 response: output to cycle, you wrote just output a value of the output change should be ok, I put you in the first two if the merger, can the # include & lt; stdio.h> #include Int main () {Int a [10] [10]={0}; for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {If (j==0 | | j==I) {A [I] [j]=1; } The else A [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j]. } } for (int i=0; I & lt; 10; + + I) {For (int j=0; J & lt;=I; + + j) {Printf (" % d ", a [I] [j]); } printf("\n"); } return 0; } #include The header file I forgot to delete, delete it
Page link:https//www.codepudding.com/Backend/112955.html