Compare commits
No commits in common. "4531049ff260118822f8b28f7c88e8f09dd90cf4" and "9ece98fece60e5179e97a2d40df9e33785665b28" have entirely different histories.
4531049ff2
...
9ece98fece
|
@ -95,23 +95,16 @@ public class Lab2 {
|
|||
// System.exit(0);
|
||||
}
|
||||
}
|
||||
// todo check repetition of minimal elements
|
||||
int sum = 0;
|
||||
for (int j = 0; j < MATRIX_C[0].length; j++) {
|
||||
int tmpSmallest = MATRIX_C[0][j];
|
||||
boolean valueRepeats = false;
|
||||
for (int i = 1; i < MATRIX_C.length; i++) {
|
||||
if (MATRIX_C[i][j] < tmpSmallest) {
|
||||
tmpSmallest = MATRIX_C[i][j];
|
||||
valueRepeats = false;
|
||||
} else if (MATRIX_C[i][j] == tmpSmallest) {
|
||||
valueRepeats = true;
|
||||
}
|
||||
}
|
||||
sum += tmpSmallest;
|
||||
|
||||
if (!valueRepeats) {
|
||||
sum += tmpSmallest;
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
public class Lab3 {
|
||||
public static void main(String[] args) {
|
||||
String s = "ASD";
|
||||
String s2 = s;
|
||||
System.out.println("s2 = " + s2);
|
||||
System.out.println(s == s2); // true?
|
||||
System.out.println(s.equals(s2)); // true?
|
||||
s += "B";
|
||||
System.out.println(s);
|
||||
System.out.println("s2 = " + s2);
|
||||
|
||||
System.out.println(s == s2); // false?
|
||||
System.out.println(s.equals(s2)); // false?
|
||||
|
||||
String s3 = new String("ASD");
|
||||
System.out.println(s3 == s2); // true? (false)
|
||||
System.out.println(s3.equals(s2)); // false? (true)
|
||||
|
||||
// String Pool
|
||||
String s4 = "ASD";
|
||||
System.out.println(s4 == s2); // true?
|
||||
System.out.println(s4.equals(s2)); // (true)
|
||||
|
||||
System.out.println("Done!");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue