RSS

contoh bermain logika menggunakan perulangan for

03 May

package bangke.perulangan_for25;

public class perulangan_for25{
public static void main(String[]bangke){
for(int x=0; x<8; x++){
System.out.print(“\t\t\t”);

for(int y=0; y<8-x; y++)
System.out.print(” “);

for(int y=0; y<2*x-1; y++)
System.out.print(“!”);
System.out.println(“”);
}

for(int x=8; x>0; x–){
System.out.print(“\t\t\t”);

for(int y=0; y<8-x; y++)
System.out.print(” “);

for(int y=0; y<2*x-1; y++)
System.out.print(“!”);
System.out.println(“”);
}

for(int x=0; x<8; x++){
System.out.print(“\t\t\t”);

for(int y=0; y<8-x; y++)
System.out.print(” “);

for(int y=0; y<2*x-1; y++)
System.out.print(“!”);
System.out.println(“”);
}

for(int x=8; x>0; x–){
System.out.print(“\t\t\t”);

for(int y=0; y<8-x; y++)
System.out.print(” “);

for(int y=0; y<2*x-1; y++)
System.out.print(“!”);
System.out.println(“”);
}
}
}

 
Leave a comment

Posted by on May 3, 2011 in about me

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: