Thread: need some help
View Single Post
  #2 (permalink)  
Old 04-12-2008, 04:38 PM
gszauer's Avatar   
gszauer gszauer is offline
Programmer
 
Join Date: Nov 2007
Location: Florida
Age: 18
Posts: 113
Credits: 0
Rep Power: 4
gszauer is on a distinguished road
Default Re: need some help

You have nothing to turnicate one row, and start the second.
Do this
import java.util.*;

Code:
public class puzzle{
  final static int MAX_ROW = 8;
  final static int MAX_COL = 4;
  static int numRow;
  static int grid[][] = new int[MAX_ROW][MAX_COL];
  public static void main(String[] args){
    System.out.println(" Enter the number of row:");
    Scanner myScanner = new Scanner(System.in);
    numRow = myScanner.nextInt();
    for(int i = 0; i < numRow; i++)    {
      for (int j = 0; j < MAX_COL; j++)    {
        System.out.print(grid[i][j]);
      }
      System.out.print("\n");
    }
    System.out.println();
  }
}
__________________
Quote:
Originally Posted by ~Aristotle
It is the mark of an educated mind to entertain a tought without accepting it
If my post was helpful, please help me build some rep
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote