Friday, February 12, 2010

Program Piramida

/**
* @(#)dina.java
*
* dina application
*
* @author
* @version 1.00 2009/11/7
*/
import java.io.*;
public class dina
{
private static BufferedReader stdin =
new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws IOException
{
int j,k;
System.out.print("Masukkan Angkanya : ");
String input = stdin.readLine();
int a = Integer.parseInt(input);
String niesya=" ";
for(int i=0;i-1 {
for(j=a;j>i;j--){
niesya +=" ";
}
for(k=1;k<=i;k++){
niesya +=k;
}
for(k=i-1;k>=1;k--){
niesya+=k;
}
niesya +="\n";
}
System.out.print(niesya);
}
}

3 comments:

  1. wow... program aph tu??? ajarin dong...hehe

    ReplyDelete
  2. tinggal d compile doang tuh program

    ReplyDelete
  3. @ozy : program java..boleh klo agy free time..

    @phonk : saudari yuni yg saya hormati..program tersebut ud jadi dan tinggal d compile lalu d running..dijamin nothing error...terima kasih...

    ReplyDelete