for (int i = 1; i <= rows; i++){ for (int j = 1; j <= col; j++){ String line = scan.nextLine(); while (!line.equals(null)){ if (line.equals(" ")){ System.out.println("empty line"); } double value = scan.nextDouble(); switch (c){ case 1: col1+=value; break; case 2: col2+=value; break; case 3: col3+=value; break; } switch(r){ case 1: row1 += value; break; case 2: row2 += value; break; case 3: row3 += value; break; case 4: row4 += value; break; case 5: row5 += value; break; case 6: row6 += value; break; case 7: row7+= value; break; } }// while } }
"1" is a string containing a single digit " " is a string containing a single space "" is an empty string
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)