Home > Back-end >  Look at the wrong which c language
Look at the wrong which c language

Time:06-06

Where did wrong? Sigh agghh agghh

CodePudding user response:

Judge condition is not,,,,
Look at the pictures difficult

CodePudding user response:

The | | condition,,, what's the number is larger than 1, and no better than 100 small? (no, so the conditions must be established, and write the if (1==1) the effect of the same)

CodePudding user response:

# include & lt; Stdio. H>

Int main (void)
{
Int n=0, I, j;
Int a [10] [10]={0};
Printf (" do input the Max num: ");
The scanf (" % d ", & amp; N);
If (n & lt; 1 | | n & gt;=10)
{
Printf (" input error, both please check... \n");
return 0;
}
The else
{
A [0] [0]=1;
For (I=1; i {
A [I] [0]=a, [0] [I - 1].
For (j=1; J & lt;=I; J++)
{
A [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j].
}
}
//print
For (I=0; i {
For (j=0; J & lt;=I; J++)
Printf (" % d ", a [I] [j]);
printf("\n");
}
}
return 0;
}

CodePudding user response:


Int main () {
Int I, j, a [100] [100]={1};
int n=10;
//the scanf (" % d ", & amp; N);
For (int I=0; i<=n; I++) for (int j=0; J<=n; J++) a [I] [j]=1;
For (int I=2; i<=n; I++) {
For (j=1; JA [I] [j]=[I - 1] a [j - 1) + a, [I - 1) [j].
}
for (i=0; i<=n; I++) {
for (j=0; J<=I; J++)
Printf (" % 4 d ", a [I] [j]);
printf("\n");
};
return 0;
}

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