0 like 3 dislike
6.5k 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
| 6.5k views

58 Answers

0 like 0 dislike
Hidden content!
* ** *****


main()

{
int a,i,j,k,l,m;
* * ** * * a Number\n");
*** ** ** ** ** * ** *

for (i=0;i<=a;i++)
{
*** *** * * * * * * * ******
**** * * ** *
* ** * * *** ** ******* **** * *** ");
* * * ** *** *
** * **** * ****** * **** * * *
* *****
** * ** *** * *** *
*** **** ** *
****** *** *** * * *** *
* *** **
** **** ** ** **** * * * ** *
* * *

** * ** **** * *
}
return 0;
}
answered by (-32 points)
0 0
prog.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main ()
{
* **** **** * * a;
* * *** ** * * * * ** * * **** ** *****
*** * * **** *** ***** * *** ** ** * * ** ** * ** ** *
*** * *** * * ** ** ** * ** ** * ** ** * * ** * ***
** * * *** ***** ** * *** * * *** * *  12321\n",a);
******* *** ** * ** *** * **** * 1234321\n",a);
** ** * ** ** ** ***** ** * * ** * ** ** ** *** * *
* *** ** *** *** * ** ***** ** ** ******* ** ******* *** 0;
}
answered
0 0
prog.c: In function 'main':
prog.c:5:11: warning: too many arguments for format [-Wformat-extra-args]
     scanf("number",&a);
           ^~~~~~~~
prog.c:6:12: warning: too many arguments for format [-Wformat-extra-args]
     printf("    1\n",a);
            ^~~~~~~~~
prog.c:7:12: warning: too many arguments for format [-Wformat-extra-args]
     printf("   121\n",a);
            ^~~~~~~~~~
prog.c:8:12: warning: too many arguments for format [-Wformat-extra-args]
     printf("  12321\n",a);
            ^~~~~~~~~~~
prog.c:9:12: warning: too many arguments for format [-Wformat-extra-args]
     printf(" 1234321\n",a);
            ^~~~~~~~~~~~
prog.c:10:12: warning: too many arguments for format [-Wformat-extra-args]
     printf("123454321\n",a);
            ^~~~~~~~~~~~~
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main()
{
** * * * ** **** ** a;
**** ***** *** * * * *** * ** * ***
* * * *** ** * ** ** *** ** ***** * ****** * ***
** **** ** * * * ** * ** ** *** ** * **** **
* * * * ** *** * * ** *** *** ** ** ** * *** *** **
****** * ** ********** *** * **** 1234321\n");
** *** ** ** * ** * * *** * * * ***** * *
**** * ** *** ******** * 0;
}
55/100 answered
0 0
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int rows,i,e,rows2;

int main()
{
* *** * ** *** **** * *** *** ** **** *** * * * *****
** * * *** * * * * ** **
** *** * * * ** * * ****** * * * **

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


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


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

** * ** ** * * ** ** *** 0;
}
answered by (-286 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,j,k,i;
** * * * * ** * * * ** ** **** ** * *** **
    for(i=1;i<=r;i++)
    {

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

* *** ** *** * * * * ** * **** * *** **** *** *
* * ***** **** ** **** * *** ***
** ** * * * * ** **** * ** *** ******* ***** * * ****** * * * **** * **** * * ** *
** **** * ** * ** ** * * ** * ** ** ** * * * **** **
    }
}
answered by (-249 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
   int n,i,j,k,y;

** * * ** *** ** **** * ** * * ** &n);

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

**** ** *** * * **** ** * * * **
* *** * ** * ****** *** * * * *** ** ;
* * ***** * ** * *

*** *** * *** * * * * ** *** ** *
* * ** ** ** * *** * * *** *** **
* **** * ****** ***** *** 0;
}
answered by (-167 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>
#include <stdlib.h>

int main()
{
*** * *** ** *** * * a,i,j,k,l,cnt = 0;
** * * ** * ** ** * * * * *** * ***
** * ***** ** ************ * = 1 ; i <= a ; i++)
    {
** *** *** **** ** *** ** * ** * * * * ** = i ; j <= a - 1 ; j++)
*** * * *** * * *** * ** ** ** ** ** ** * ** **** * ** * *** * ** * ** ** ");
* * * * *** ** * * *** * ** * ** **** ** = 1 ; k <= i ; k++)
* *** *** ** * ***** * * ** ***** * * **** * **** * ** * * * * * *** * * *** ** * *** ***
**** *** * * * * ** ** *** ** **** *** * *** = i - 1 ; l >= 1 ; l--)
** ** * ** *** * ** * ** * **** * ** *** * * **** * ******* ***** * * **** * ** * ****
** * *** * * * * ** ** ** * * * *** * ** * ** * != 0)
* * * * * * ** * ** ** ******* ** *** ***
* *** ** **** **** **** * ** * ** * ** * * ** * *** *** ** ** ** ***
** * * ** **** ***** ** ** * * ** ****** *** * * ** * * * ** <= a - 1)
* ** * ***** * * ** * * *** ***** * **** ** * ** * * * * * * *** * **** ** ** ** ** * * ****
** ***** ** ** ****** ** ** * * * * **** *
    }


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

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

int main()
{
* * * **** * * * * *** * * a,i,j,k,l;
*** * * * * * *** *** *** ** * *** *
* ***** ** *** *** * = 1 ; i <= a ; i++)
    {
* ** * * ** * ** **** **** ** * * * = i ; j <= a - 1 ; j++)
** *** * **** ******* ***** ** * *** * **** * * * * ** ** ***** * * * ");
** * * *** * ** **** ** * * * * = 1 ; k <= i ; k++)
** ** ***** * * * * ** *** * **** * * ** ******* ** * * * * * * ****** ******* * **** * *
* *** * * * ******* *** * * * * * * = i - 1 ; l >= 1 ; l--)
* ***** * ***** ** ** **** * ** * * **** ** *** *** ** *** * ** *** * * *
** * * ** ** * * **** * * *** * * != 0)
**** **** *** * *** ** **** ** *** * * ****** *** * *** **** * **** ** * *
* * * ** *** ** * **


* * ** * ** * * * 0;
}
answered by (-255 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.70.100.103
©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
| 2.6k 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
| 2.8k 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
| 7.1k views
12,783 questions
183,442 answers
172,219 comments
4,824 users