java - array - spiral

Download Java - array - spiral

If you can't read please download the document

Upload: kasiful-aprianto

Post on 28-Dec-2015

7 views

Category:

Documents


1 download

TRANSCRIPT

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. *//** * * @author root */import java.io.*;public class Soal8_4 { static int [][]spiral(int nilai){ int arr[][]=new int [nilai][nilai]; int x=nilai/2; int y=nilai/2; boolean atas=true; boolean kiri=false; boolean kanan=false; boolean bawah=false; int j=1; for(int i=1;i