Batel Ratzon
New member
מערך דו מימדי
זה מה שכתבתי
public class matrixInit
{
public static void main (String[]args)
{
int[][]a= { {0,0,1,1,1,1},
{1,0,0,1,0,1},
{0,1,0,1,1,0},
{0,0,0,0,0,0},
{1,1,1,1,0,1},
{0,0,1,1,1,0}
};
System.out.println("number of lines: "+ a.length );
System.out.println("number of columns: "+ a[0].length);
}
public static int sumRow (int[][] a, int row)
{
int sum=0;
for(int col=0; col<a[row].length; col++)
{
sum+= a[row][col];
}
return sum;
if (sum ==0)
}
}
עשיתי ספירה של המספרים שאם כולם 0 יתחיל לבדוק את הטורים
נתקעתי בחלק שבו אני צריכה לצרף לבדיקה טור
אשמח לעזרה
זה מה שכתבתי
public class matrixInit
{
public static void main (String[]args)
{
int[][]a= { {0,0,1,1,1,1},
{1,0,0,1,0,1},
{0,1,0,1,1,0},
{0,0,0,0,0,0},
{1,1,1,1,0,1},
{0,0,1,1,1,0}
};
System.out.println("number of lines: "+ a.length );
System.out.println("number of columns: "+ a[0].length);
}
public static int sumRow (int[][] a, int row)
{
int sum=0;
for(int col=0; col<a[row].length; col++)
{
sum+= a[row][col];
}
return sum;
if (sum ==0)
}
}
עשיתי ספירה של המספרים שאם כולם 0 יתחיל לבדוק את הטורים
נתקעתי בחלק שבו אני צריכה לצרף לבדיקה טור
אשמח לעזרה