y****m 发帖数: 35 | 1 Who knows how to write a class for a checkboard pattern, 8*8.
Must only use one instance of the following commands:"*","",
and"/n".
Thanks a lot!
www.webterrace.net/files/getprogram.phd?id=14 |
S*********g 发帖数: 5298 | 2 for(int i = 0;i<8;i++)
{
for(int j=0;j<8;j++)
{
if((i+j)%2==0)
System.out.print("*");
else
System.out.print(" ");
}
System.out.print("\n");
}
【在 y****m 的大作中提到】 : Who knows how to write a class for a checkboard pattern, 8*8. : Must only use one instance of the following commands:"*","", : and"/n". : Thanks a lot! : www.webterrace.net/files/getprogram.phd?id=14
|
y****m 发帖数: 35 | 3 So it should be like
class checkboard
{
public static void main( string arg[])
{
int i,j;
for(int i = 0;i<8;i++)
{
for(int j=0;j<8;j++)
{
if((i+j)%2==0)
System.out.print("*");
else
System.out.print(" ");
}
System.out.print("\n");
}
Do I still need delare the class first? |
S*********g 发帖数: 5298 | 4 I don't understand your question.
【在 y****m 的大作中提到】 : So it should be like : class checkboard : { : public static void main( string arg[]) : { : int i,j; : for(int i = 0;i<8;i++) : { : for(int j=0;j<8;j++) : {
|
m******t 发帖数: 2416 | 5
I thought the question was pretty clear and straightforward -
"Could you please do my homework for me?"
【在 S*********g 的大作中提到】 : I don't understand your question.
|