由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Starter's problem
相关主题
Apply lock on a class.JAMWiki, anyone used it?
问一个关于access object instance的问题用js写过file upload的来帮个忙吧
Core J2EE Design Pattern这道题该走什么路
求一本关于Design Pattern,UML和JAVA的经典书籍Talk a little more about How to lock a file
Java/J2EE的书Re: Entity EJB: anyone with real experience
关于Java design patternRuntime.exec() 问题
纯ajax的app是不是比mvc的要难很多help on this scope question
Spring question, redirect and carry data over?A question about inheritance
相关话题的讨论汇总
话题: int话题: starter话题: checkboard话题: class话题: problem
进入Java版参与讨论
1 (共1页)
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.
1 (共1页)
进入Java版参与讨论
相关主题
A question about inheritanceJava/J2EE的书
怎么能够减少image上的锯齿?关于Java design pattern
在一个函数里把arraylist设为null 但是有问题纯ajax的app是不是比mvc的要难很多
发现 synchronized 的一个问题Spring question, redirect and carry data over?
Apply lock on a class.JAMWiki, anyone used it?
问一个关于access object instance的问题用js写过file upload的来帮个忙吧
Core J2EE Design Pattern这道题该走什么路
求一本关于Design Pattern,UML和JAVA的经典书籍Talk a little more about How to lock a file
相关话题的讨论汇总
话题: int话题: starter话题: checkboard话题: class话题: problem