avatar
Starter's problem# Java - 爪哇娇娃
y*m
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
avatar
S*g
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

avatar
y*m
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?
avatar
S*g
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++)
: {

avatar
m*t
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.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。