Home > Back-end >  C program design
C program design

Time:06-11

This program where there is a problem?

CodePudding user response:

Do you want to do, Yang hui triangle

CodePudding user response:

What's the problem? Compile the problem? Run problem? Will you take to ask?

CodePudding user response:

reference 1st floor qq_45798109 response:
what do you want to do, Yang hui triangle?

Yeah, sure enough the great god, a see will know, I where there is a mistake? Hope glad

CodePudding user response:

refer to the second floor SuperDay response:
what is it? Compile the problem? Run problem? Will you take to ask?

This is the topic of Yang hui triangle, this program has a problem can't run, but I don't know where is wrong? Hope glad

CodePudding user response:

reference 5 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;
}


CodePudding user response:

refer to 6th floor qq_45768878 response:
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;
}



O is the output before ten lines,,,

CodePudding user response:

Output to cycle, you write just output a value of the output change should be ok, I put you in the first two if merged, 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;
}

CodePudding user response:

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

CodePudding user response:

references 9 f qq_45798109 response:
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

谢谢你

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related