I have a piece of code, for example, writing number 5 and I get the pyramid with number 5

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

Need to look like

 ****1 ***22 **333 *4444 55555 

A piece of my code

 for (i = 0; numero > i; i++) { for (k = i; k >= 0; k--) { printf("*"); } printf("n"); } system("PAUSE"); 

    2 answers 2

    Let us think too, okay?

    In the i th line, we need to give (1) how many stars? (2) how many numbers? (3) which numbers exactly?

    As soon as you answer these questions, the code will become self-evident.

       for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) if ( j < (N - (i + 1)) ) printf("*"); else printf(i+1); printf("\n"); } 
      • 2
        Yyyyy. And what does the author of the question learn by getting ready-made code? Will you be programming it all your life? - VladD
      • 2
        He will never program if he asks for help in case of such problems. In fact, it may be possible for the student to help drag another good grade and get a piece of candy from her mother. Yes, and just nothing to do - VorobyevEvgeniy
      • five
        “You shouldn’t regret the bad guys - one of them will most likely become your boss” (c) - VladD