Home > Back-end >  N) output line graphics, when n is 4, graphic below.
N) output line graphics, when n is 4, graphic below.

Time:09-26

N line graphics, when n is 4, graphic below,

CodePudding user response:

To join https://ask.csdn.net/questions/1053613

CodePudding user response:

For reference graph is easy,
 
#include
using namespace std;

Int main (void)
{
Int I, j, k, n;
Cin & gt; & gt; n;
For (I=n; i>=1; I -)
{
For (j=1; J<=n - (I); J++)
{
Cout & lt; <"";
}
For (k=1; K<=I * 2-1; K++)
{
Cout & lt; }
Cout & lt; }
For (I=2; I<=n; I++)
{
For (j=0; J{
Cout & lt; <"";
}
For (k=1; K<=I * 2-1; K++)
{
Cout & lt; }
Cout & lt; }

return 0;
}

  • Related