Documente Academic
Documente Profesional
Documente Cultură
*;
public class bufferedreader
{
public static void main(String args[])throws IOException //main class
{
BufferedReader watta = new BufferedReader(new InputStreamReader(System.in));
int indexNum[][] = new int[4][3];
//int arraySize=0;
System.out.print("Enter 12 integers: ");
for(int a=0;a<indexNum.length;a++)
{
for(int b=0; b<indexNum[a].length; b++)
{
indexNum[a][b]=Integer.parseInt(watta.readLine());
}
}
System.out.println("----------------------------------------------------");
System.out.println("Matrix:");
for(int a=0;a<indexNum.length;a++)
{
for(int b=0; b<indexNum[a].length; b++)
{
System.out.print(indexNum[a][b] + "\t");
}
System.out.println();
}
System.out.println("----------------------------------------------------");
System.out.println("Copying the elements to another Index:");
for(int a = 0; a < indexNum.length; a++)
{
for(int b = 0; b < indexNum[a].length; b++)
{
int indexNum2[][] = new int[4][3];
indexNum2[a][b] = indexNum[a][b];
System.out.print(indexNum2[a][b] + "\t");
}
System.out.println();
}
System.out.println("----------------------------------------------------");
sumrows(indexNum);
System.out.println("----------------------------------------------------");
sumcolumns(indexNum);
System.out.println("----------------------------------------------------");
largestrows(indexNum);
System.out.println("----------------------------------------------------");
largestcolumns(indexNum);
System.out.println("----------------------------------------------------");
maxV(indexNum);
System.out.println("----------------------------------------------------");
minV(indexNum);
System.out.println("----------------------------------------------------");
evenodd(indexNum);
System.out.println("----------------------------------------------------");
}
public static void sumrows(int indexNum[][]){
int sum1;
for(int a = 0; a < indexNum.length; a++){
sum1 = 0;
for(int b = 0; b < indexNum[a].length; b++)