Home > Back-end >  How the output not T a diamond?
How the output not T a diamond?

Time:06-09

# include
Int main () {
Int T, I, j, b, c, n;
char ch;
The scanf (" % d ", & amp; T);
For (b=1; B<=T; B++) {
The scanf (" % c % d ", & amp; Ch, & amp; N);
j=1;
While (n>=1) {
for(i=1; IPrintf (" ");
}
for(i=1; I<=j; I++) {
Printf (" % c ", ch);
}
J +=2, n -;
printf("\n");
}
N=1, j -=4;
While (j>=1) {
for(i=1; I<=n; I++) {
Printf (" ");
}
for(i=1; I<=j; I++) {
Printf (" % c ", ch);
}
N++, j -=2;
If (b<=T | | j>=1) printf (" \ n ");
}
The scanf (" ");
}
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