java 基础
int min = 0;
for (int col = 0; col < 3; col++) {
int row = 0;
try {
min = inArray[row][col];
} catch (ArrayIndexOutOfBoundsException e) {
row++;// 如果越界row在加一行
min = inArray[row][col];
}
for (row = 0; row < outArray.length; row++) {
try {
if (min > inArray[row][col]) {
min = inArray[row][col];
}
} catch (Exception e) {
continue;// 当比较时如果列上没有数字就跳出来。进行下一行比较
}
}
outArray[col] = min;
}
for (int i = 0; i < outArray.length; i++) {
System.out.print(outArray[i] + " ");
}
}
/**
* "判断一个字符串是否是首字母大写,其余字母都是小写。 例如 输入:True 输出: true"
*/
public static void third() {
System.out.println("请输入字母:");
Scanner input = new Scanner(System.in);
String ret = input.next();
// 把首字母拿到变成大写。
String s = String.valueOf(ret.charAt(0)).toLowerCase(); // 再把转换完的大写和原来的首字母替换掉
String res = ret.replace(ret.charAt(0), s.charAt(0));