import java.io.BufferedReader;
import java.io.InputStreamReader;
public class TwoDTesting
{
public static void main(String[] args) throws Exception
{
final int ROWS = 2;
final int COLS = 2;
int arr[][] = new int[ROWS][COLS];
int r;
int c;
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Set Values\n");
for(r=0; r<ROWS; r++)
{
for(c=0; c<COLS; c++)
{
arr[r][c] = Integer.parseInt(buf.readLine());
}
System.out.println();
}
System.out.println("Set Values\n");
for(r=0; r<ROWS; r++)
{
for(c=0; c<COLS; c++)
{
System.out.print("\t"+arr[r][c]);
}
System.out.println();
}
}
}
import java.io.InputStreamReader;
public class TwoDTesting
{
public static void main(String[] args) throws Exception
{
final int ROWS = 2;
final int COLS = 2;
int arr[][] = new int[ROWS][COLS];
int r;
int c;
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Set Values\n");
for(r=0; r<ROWS; r++)
{
for(c=0; c<COLS; c++)
{
arr[r][c] = Integer.parseInt(buf.readLine());
}
System.out.println();
}
System.out.println("Set Values\n");
for(r=0; r<ROWS; r++)
{
for(c=0; c<COLS; c++)
{
System.out.print("\t"+arr[r][c]);
}
System.out.println();
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.