0 like 3 dislike
11.8k views

Print this pattern

Input

5

Output

    1
   121
  12321
 1234321
123454321

Input

8

Output

       1
      121
     12321
    1234321
   123454321
  12345654321
 1234567654321
123456787654321

 

[Exam] asked in Midterm by (12.1k points)
ID: 32710 - Available when: 2017-11-15 14:10 - Due to: Unlimited
| 11.8k views

58 Answers

0 like 0 dislike
Hidden content!
#include *** * ** ** *
#include ** * *** * *

int main()
{
* *** ** * * *** a,i,j,s;
** * *** * * * * * * *** *** ** * * ** *
*** *** ***** *** ***** *** * *
* **** ** * *
* * * **** ** **   * * ** *
** *** * ****** * ** * **   {
    **** ** * * *** ** * * ");
    }
    ** * * * * ** *
**** * * * ** * ***   {
    ** * * * * * * * *** * ** **** * **
* * **** * * * ** ** *** *** * * **
***** ** * ** * * ** * ***** * * * *
* * * ** ******* ** ** *** * *** *** **
* * *** **** * *** ** ***** **** *** *** *** * ** * * ** * *** *  
    }
* *** *** ** **** * ***
* ** * ** ** *** * ***** * ** ***
** * * * * * ***

* * ****** **
* ** * * * ** ***** ** * 0;
}
answered by (-258 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include *** * * * * **
#include * *** * * **

int main()
{
** * ** * * a,i,j,s;
* *** * ** **** * * **** ** * * * **** *
*** * * ** ** ***** **
** ** ** * * **
** * * * * ****   ***** **** * ** *
**** ** ** * ** *   {
    * ** * ** ** * ** ** * ");
    }
    *** * ** * *** **
**** * **** * **** ***   {
    * ** * * * **** * ** *** * * *
* * * **** **** ** ******* * ** * * ** ****
** * * * ** * ** *** * * * * * **** * ** * *** ** * ***
*** **** **** ** * * ** * * * * *
** *** *** *** * * * * ** * *** * ***** * * * * ** * *** **** * * ** *  
    }
* * * ** * ** * *** *** * **
******* * * ** **

* ** * ** ** **
* * ** * * * * * * 0;
}
answered by (-258 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{
    int n, c, d, num = 1, space;

* ** * * *** **** * ****** * **** ****

* * ** * *** * *** * **** = n - 1;

    for ( d = 1 ; d <= n ; d++ )
    {
**** ***** ** *** ** * *** ** ** ** * * * ** = d;
* ** * * * ****** ** * * **** * ******* **** * ( c = 1 ; c <= space ; c++ )
** ** ** *** * * * * * **** **** * * * **** ******* *** *** *** ** * ****** ");

* ** ** * * * * * ** *** * * * ** * ** **

* ** * ** * *** * * ****** * * ** ** * ***** ( c = 1 ; c <= d ; c++ )
* * * *** ** * * * * * *** * **
***** ** * ** *** * ********** ** ** ** * *** ** *** ************ * * * * * * num);
** ** ******* *** *** **** * ** * ** * * *** * ** **** * ** * *
* **** * * **** * **** * * *** * * * *** *** * *
* ***** * * *** * ** ** * * ** * **
* * * * * * *** * * ** * ** ** * ( c = 1 ; c < d ; c++)
* **** ** * ****** **** ** * ** ** **** ***
** ** *** **** * **** * ** * ** *** ***** *** * **** ** * ** * ** * * *** num);
** *** *** * * ** * * * * *** * ** ******** * ****** *** *** ** **
* * **** * ** *** ** ** *** ** * *******
** * * **** * * ****** * * ** ********* * * ** *** * * * * *
    }

***** * ** ***** *** 0;
}
45/100 answered by (-168 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>

main()
{
    int n, c, d, num = 1, space;

****** ** * * * ** ** **** * ** * * * ** *****

* * ** *** ****** * * = n - 1;

    for ( d = 1 ; d <= n ; d++ )
    {
* **** ** * * * * * ** ** * * * **** = d;
* * * *** * ******** ** **** * * ** ** ( c = 1 ; c <= space ; c++ )
** ** *** * * * * * * * * *** * * ** * ** * *** *** ** * ** * ** *** ");

* ** * ** *** * * * ***** * * ** * * *** * * **

* * * * * * ** * * * * ******* * ** * * * * *** * ( c = 1 ; c <= d ; c++ )
* * ** * ** **** *** * * ***** * * * ** * *
* *** *** * * ** * ** *** *** * * * ** * * * * **** * *** ***** * * **** ** * num);
**** ** * * ** * * **** ** **** * * * ** * * ** * *** * * * **
** * ** **** *** * *** ** * ** ** **** ** * **
**** * *** **** * * * * ***** * *
**** * *** * ***** *** * *** ****** * ** ( c = 1 ; c < d ; c++)
* * ** * * * ** *** * * * **** * * *** *** **
* ****** * ******* * * **** **** * * ** * ** * * * ** * * ** * * *** * ** ** ** * * * num);
** ** ** * * * * ******** * * * * * ** **** * * * **** * *
* ***** * *** **** **** * ** ** *** *
* ** **** *** * *** * *** ** ** ***** **** * * ** * * **
    }

* * ** * *** ** ** ** **** 0;
}
20/100 answered by (-168 points)
0 1
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(){
* * ** * ** * * * **** n;
*** ** * * * * *** * i,j;
* * * ** **** **** **** *** * * ******** ***
***** * * * ** ** * * * *** ** *
** **** ** ***** * **
**** **** ** * * ****** ** **** **
*** *** ** *** *** ** * * * ** * ** *** **** * ** * *** * **** ");}
* *** * *** **** ** * ****** ** *** *
    {
* ******** * ** *** **** ** * * * ** * *** ** ** *** * * **
* *** **** * ** **** * * * * *
*** * **** ** * * ** ***

** *** ** ** ***** * * * * ** ** *** *** ** **** **** *
 }
   return 0;
   }
40/100 answered by (-32 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
    int x,n,i,a;
** * ** ** *** * *** *** * ** * * * ** **
    for(i=1;i<=x;i++)
    {
*** * * * * *** **** *** *** * ** * * * * * **
****** * ** * * ***** ** ** * * * *** ** **
* **** **** *** ***** * ** **** * * * ** ***** *** ** *** ** *** * ");
* ** ** * * ** ** * * * * * * * **
* *** * ** * ** * * *** ** * ** * ****** * ** **
* * ** * **** * ** * ***** ** * * **** * ** ** ** *
* * ** * ** ** *** * ** ** * * * * ** ** * *** * * * * *** ** * *

*** * *** ***** ** * * **** *** *
* ** * ** ** * * ** **** * ** * * * *** * * *
* * ****** * *** * * ******** ** *****
* * ** * * **** ***** * * * * ** * **** * ** ** * *** * * ** * *** * ** ***** *
**** * * *** * ** * * **** * *
* *** * * **** * * * ** ** * ** * ** ***** * * * ** * ***** *** * **
    }
    return 0;
}
90/100 answered by (-281 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
    int x,n,i,a;
** ** * ** * * *** ** *** * *** * *** * *
    for(i=1;i<=x;i++)
    {
* * *** * * *** ** * * * ** * * * *** * * ** * * * **
* * * ** * **** * * **** **** ** ***
* ** * * *** * * ** * ***** * * *** ** *** *** * ** * * * *** * * ** ");
** * ***** *** ** * * ** **** ** **** * ****** *
** * **** ** *** * * * * *** * ** * ** *** * * *
* **** * * ** * * * ** *** * *** * ***
* * ** * ***** * **** * *** ***** ******* ** *** **** * **** ** ** ***** **

*** ***** * ********** ** * ** *** * *****
* * ** *** * * * * **** ** * * * * ** **** * ** ** * ***
* * *** **** *** * * *** * ***** *** ** * **
* * ** ** ** *** * ** ** * * * ***** * * * ** * *** *** * **** ****** * * *** *
* * *** ***** ** ** * * *** * * * * *
* * *** * ** ** * ** ** * **** **** * *** ******* * ** * *
    }
    return 0;
}
answered by (-281 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
int rows,i,ii,iii,my;

*** ***** ** **** ****** *

for(i=1; i<=rows; i++)
**** * ** * * * ** **
* * * * * *** * * *** * my<rows-i; my++)

*** * * * * * ** *** *** * * * * *** ** * * ");

** *** * * **** * ** ii<i; ii++)
* *** ** ***** * **
* * ***** * ** * * * * * * * *** ** **** * ** ** * * **
** ** * ***** * ** ** *
* * * * * * * * * ** iii>=1; iii--)
* * * ****** * **** *
** * * * * ** *** * *** * **** * * * * * ** ** ***** ***** **** **
* * * * *** * * * *** *
**** *** ** * ** ** (i<rows)
** * ** * * * *** **
*** ** ** * ** * ** ** ***** ***** * ** * * ** *** ** *
*** * ** ** ******** **
* * ** * * *** * * **

return 0;
}
answered by (-254 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main (void)
{
    int a,b,c,d,e;
* * *** * * * ** ***** * ** * * ** * ** *
    for (b=1;b<=a;b++){
*** * * * * **** * * ** * *** ** ** *** *** (c=1;c<=a-b;c++){
*** *** * * * * * * *** **** ** * * ** * ** * ***** * * * * ** * * * ");
* ** * * ** * *** * **** * * * *** * *** ** *** * * * * *** * ** *
****** * ****** * * **** ** *** * * (d=1;d<b;d++){
* * * * * ** ** * * * * * * * ** ***** * * *** ** * *** * * ** * * ** *** ** ***** * ** * * **
****** ***** * ******* ** * ** * * * ** **** *** **
* * **** * * ******** **** ***** * * * ** * ** ** ****** * * *** * ** *
**** * *** ** ** * ***** * ***** ** * * (e=b-1;e>0;e--){
** * ** ** ***** ** * * * * ** ** ** *** * *** ** *** * ** * * * * * ** * ** ***** ** * ** * * * *
* * * * * ** ** *** ** ** **** *** **** ***
** *** *** * ** ** **** *** * * ** *** * ** * (a!=b){
** * ** **** **** ** ** * * * ** * * **** * ** * * * *** * *
** * * * * *** *** **** * * ***** ** * ******* ****
    }
}
answered by (-204 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{



int rows,i,ii,iii,m;

*** ** * * * * * ** *

for(i=1; i<=rows; i++)
*** * *** ***** * ***** * *****
* * *** * *** * * * * * m<=rows-i; m++){

** ** * * * * * * ** ** * * *** * * * * *** * * *** ");}

** *** * * * * *** **** * * * ii<i; ii++)
* **** * ** ***** *
** * **** * **** * * ** ***** ** * *** ***** * *** ** * ** * * **
** * ** *** * *******
** ** ** * * * * * ** iii>=1; iii--)
* ** * *** * ** * ** *
* *** * ** ** * * * ** * * * ** ** * ***** ** * * * * ****
* ***** **** * ***** **
* * * *** *** ***** * * ** (i<rows)
***** * ** * * **
* * * * * **** **** **** * * * **** * * *** * * * ********* * *
** * * ** **** * **
** *** ** * * *
return 0;
}
50/100 answered by (-167 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.130.93
©2016-2025

Related questions

0 like 0 dislike
15 answers
[Exam] asked Dec 9, 2017 in Midterm by thopd (12.1k points)
ID: 36755 - Available when: 2017-11-15 14:10 - Due to: Unlimited
| 4.8k views
0 like 0 dislike
19 answers
[Exam] asked Dec 9, 2017 in Midterm by thopd (12.1k points)
ID: 36750 - Available when: 2017-11-15 14:10 - Due to: Unlimited
| 5.2k views
1 like 1 dislike
59 answers
[Exam] asked Nov 15, 2017 in Midterm by thopd (12.1k points)
ID: 32351 - Available when: 2017-11-15 14:10 - Due to: Unlimited
| 12.9k views
12,783 questions
183,442 answers
172,219 comments
4,824 users