Home > Back-end >  Java
Java

Time:10-26

Electronic equipment according to the Numbers are used for two-dimensional arrays, please use a two-dimensional array to define and display an array, such as: 8,
The number is the space, _, | of three symbols,


CodePudding user response:

Char [] [] s={//define array
{' ', '_', ' '},
{' | ', ' ', '|'},
{' ', '_', ' '},
{' | ', ' ', '|'},
{' ', '_', ' '}
};
//show
for (int i=0; iFor (int j=0; JSystem. The out. Printf (" % c ", s [I] [j]);
}
System.out.println();
}

CodePudding user response:

reference 1st floor qybao response:
char [] [] s={//define array
{' ', '_', ' '},
{' | ', ' ', '|'},
{' ', '_', ' '},
{' | ', ' ', '|'},
{' ', '_', ' '}
};
//show
for (int i=0; iFor (int j=0; JSystem. The out. Printf (" % c ", s [I] [j]);
}
System.out.println();
}

Comrade, not ah

CodePudding user response:

What's wrong? An array of rows is wrong? Then delete the line in the middle

CodePudding user response:

Are separated, the first half of the eight

CodePudding user response:

That you spent the first line three _ good, that is the first line of Spaces to _
Electronic devices are to row with lamp (dot), you this character dalai lama was used to simulate and reach the good effect

CodePudding user response:

Our teacher said, three one-dimensional array

CodePudding user response:

The first ', '_', '
'The second '|', '_', '|'
The third '|', '_', '|'

CodePudding user response:

So-called lattice is similar to the following effect (use # instead of point here)
Char [] [] s={
{' # ', '#', '#'},
{' # ', ' ', '#'},
{' # ', '#', '#'},
{' # ', ' ', '#'},
{' # ', '#', '#'}
}

CodePudding user response:

Best wishes brother, I don't know why '|', '_', '|' this line does not separated by large, and ', '_', ' 'will

CodePudding user response:

The method that you can use the 7th floor