import java.io.*;
public class MgSq
{
public static BufferedReader input = new BufferedReader(new
public
InputStreamer(System.in));
public static void main (String args[]) throws Exception
{
int w, x, y, z, b, key;
boolean n_ok;
int [] [] square = new int [15] [15];
{
System.out.print("Size of square? ");
b = Integer.parseInt(input.readLine());
n_ok = (z<=b) & (b<=15+1) & (b%2==1);
if ( n_ok )
{
for (w=0;w<b;w++)
for (x=0;x<b;x++) square[w][x] = 0;
square[0][(int)(b-1)/2] = 1;
key = 2;
w = 0;
x = (int)(b-1)/2;
while ( key <= b*b )
{
y = w - 1;
if ( y < 0 ) y = y + b;
z = x - 1;
if ( z < 0 ) z = z + b;
if ( square[y][z] != 0 ) w = (w+1) % b;
else
{
w = y; x = z;
}
square[w][x] = key;
key = key + 1;
}
System.out.println("Magic square of size " + b);
for (w=0;w<b;w++)
{
for (x=0;x<b;x++)
System.out.print("\t"+square[w][x]);
System.out.println();
}
}
}
System.out.println("Error in number, try again.");
}
}
我不断收到以下错误:
MgSq.java:4 error: cannot find symbol
public static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
symbol: class InputStreamer
class: MgSq