0 like 3 dislike

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 (11.3k points)
Available when: 2017-11-15 14:10 - Due to: Unlimited
| 72 views

58 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,level,block,up,down;

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

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

***** ******* * ** * * * * * ** * ** **** ******* * *
** * ** ** **** * * ** * * * ** * *** * * * * * ** *** **** * **** ** * ** * **
    }

* ******** * * * * * **** ** * 0;
}
answered by (-16 points)
edited by
0 0
prog.c: In function 'main':
prog.c:8:13: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
     scanf("%d",a);
             ^
0 0
prog.c: In function 'main':
prog.c:8:13: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
     scanf("%d",a);
             ^
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
    int fst, nx, k,inc,t;
*** *** **** ** * * * * ** * * ** * ** &fst);
    for(inc=1; inc<=fst;inc++)
    { for(nx=1; nx<=fst-inc; nx++)
* ** ** * ***** * * * ** ** ** * *** *** * * * *** * * * * * * * ** * *** * * ** ***** * * ");
* **** ** ** *** *** * * * * * *** ** * *** * ** ********* ** * ** * *** ** *** ** * ***** ** **** * *** * k<=inc; k++)
** **** *** *** * *** * ** * *** ** * **
** * ** * * * * * * * * ***** * * **** *** *** ******* **** * * * ** * ** * * ** ** ** * * *** * * * ** * * * * * k);

****** ** * * * * ** * *****
** * *** **** ***** * **** * * ** * ****** ** * * * ***** * * * ****** * *** ** * * * ** ****** * **** *** ** ** * t>=1; t--)
* * * * * * ** ** ***** ** ***** ***
** ** * ** *** * * * ** **** * * * * ** ** * * * * * ** *** * **** * ** * ** ** * ** ** * *** * *** ** *** ** *** *** t);
** * ** * * *** ** **** *** ** * ***
*** ** * ** * * * * * * * * **** ** * ****** **
**** * * ** * * * * * ****** * * * **** * * ****** ** * * * * * *** *** ******
    }
return 0;
}
answered by (323 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main()
{
    int x,i,j,k,l;
***** * **** * *** * ** ** ******** ** ** ***

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

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

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

********** ** *** ** * * * ***** * *** *
* * * * * * * * * * *** *** * *** * * * ** * * ** **** *** * * ** ******
    }

    return 0;
}
answered by (-196 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include<stdio.h>
int main(void)
{
    int r,s,i,j,k;
** ** ***** * * * * * * *** ****** ***** *
    for(i=1;i<=r;i++)
** * *** * ****** * ** **** * *** * * * * ** *********
** *** * *** * ** *** * * * *** * **
* * * * ** ** *** ** * * * * * * ** * * * ** * ** * *** * *** * * * ******** ");
* * * * ** * * * * * * ***
* * * * *** * ** * * ** ** **** * * * * *** ***
* * *** ** ** * * * * *** *** *** **
* ***** ** *** * *** * *** * *** ****** ** * *** * ** ** * * ** **
** * ****** ** *** * * *** ******** * * *
* * **** ** *** ** *** *** **** **** * *** ***** ** * * *
        {
* * * ********* **** * * **** *** *** * * * **** **** ******* * * * **** * * *
* ** * *** * ** * ** **** * ** ** **
* * ***** *** * *** * * * * * * * * * * *** *** * ***
* ** * * * * **** ** * ** * * ** ** **** * ****
* * *** **** * ** * ** **** * * *** *** * * **** * ** ***** * ** * ** ** *
**** ** * ** * * * * * * * *** ** *** ** ******
  return 0;


}
answered by (-249 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
* * **** **** *
int a,i,b;
int main()
{
* ** * * * ****
****** * * ** **
{
***** * * **
** ** ** ");
**** *** ** *
* ** * ***
*** * * * * * *
* * * * *** * *
if(a<b)
** * *** ** ** *
}
}
answered by (-336 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
* **** ****
int a,i,b;
int main()
{
** ****** * * ** * *
**** *** ***** *
{
** * ****** * *
* *** * ");
**** ** *******
* ** * ** * *
*** ** ** ***
* ******* * * * *
** ** ** **** * *
}
}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{

    int i,j,k,l;
    int num;

** *** ***** * * ********* * ** * * ** &num);

*** ** * * * ** *** * ** ** **
    {
***** * * * ** * ** * * * * ** *** **** ** * * * * ** ** * * ** ***

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

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

**** * *** * * *** * * * *** **** ** ***** * (num != 1)
* ** ***** * *** * * * ** *** * * ** * **** *** *** * * ** * *** *** * * **** * * *** *
    }
******* * ***** * * ****** 0;
}
95/100 answered by (-401 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
//triangle pattern with numbers
int main(void)
{
*** * * * ****** * ** n,i,k,j,t;
* ** ** * ** * ** * ** *** **** * * &n);
* *** **** ****** *** ** ** * ** i<=n; i++)
    {
**** * *** **** *** *** ***** ** * * * ** *** in the beginning of line
* * ** ** ** * * ** ** *** *** * *** ** j<=n-i;j++)
*** * ** **** * ** * * ** ***** * **** ** ** *** *** ");
*** **** * * *** ** ** * * *** * *** * ** * * from 1 to n
* * ** ** ** * * * ** * *** * * * ** ** * * * ** k<=i; k++)
********** ** ** * * * * ** ** ** **** **** ** * * *** * * *** *** *** **** * *
* * * *** * * ** ** ** * * ***** * * ** * n-1 to 1
** **** * *** * **** * * *** ** **** * * t>=1; t--)
*** * * ** ** ***** * * ** ***** ** * ** * ******* ** ** * ********* * ** * * ** t);
* * *** ** * ** **** * * * * ** line
***** * *** ** * ******* * * * **** * **
* * ** *** * * * ***** **** ** ** * * ** *** * ** * *** * *** * *** * * *
* **** ***** **
 return 0;
}
answered by (-276 points)
0 0
Case 0: Correct output
Case 1: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.39
©2016-2019

Related questions

0 like 0 dislike
15 answers
[Exam] asked Dec 9, 2017 in Midterm by thopd (11.3k points)
Available when: 2017-11-15 14:10 - Due to: Unlimited
| 14 views
0 like 0 dislike
19 answers
[Exam] asked Dec 9, 2017 in Midterm by thopd (11.3k points)
Available when: 2017-11-15 14:10 - Due to: Unlimited
| 42 views
1 like 1 dislike
59 answers
[Exam] asked Nov 15, 2017 in Midterm by thopd (11.3k points)
Available when: 2017-11-15 14:10 - Due to: Unlimited
| 81 views
8,728 questions
70,470 answers
45,279 comments
1,844 users