/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pbo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author Fandy
*/
/*
* Nama : Fandy Adam
* Stambuk : E1E1 09 053
* Tugas Mata Kuliah : PBO
* Jurusan : IT
*
*
* SOAL 4 : MAGIC TRIANGLE
*/
public class soal4 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println(" Aplikasi Magic Triangle ");
System.out.println("=========================");
System.out.print("Masukkan tinggi segitiga : ");
int n=Integer.parseInt(input.readLine());
for(int i=0; i<n; i++) {
for(int j=n; j>=i; j--) {
System.out.print(" ");
}
for(int j=0; j<=i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
Subscribe to:
Post Comments (Atom)






0 comments:
Post a Comment