嗨我想知道如何输入分隔空格的字符" "在java中使用scanner例如第一行包含(int)T(没有测试用例)第二行包含{int(N)}字符数组大小的空格然后包含{int(X)}进行某些操作然后在下一行它包含(char ch(N),输入1和0,每个字符用空格分隔
样品:
答案 0 :(得分:0)
您可以使用Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int x = sc.nextInt();
int y = sc.nextInt();
for (int i=0;i<x;i++) {
int temp = sc.nextInt();
System.out.println(temp);
}
method,它会处理新的行和空格字符。请在下面找到代码段。
import java.sql._
val st: PreparedStatement = dbc.prepareStatement("""
INSERT INTO """ + table + """ as tb """ + sliced_columns + """
VALUES"""+"(" + "?, " * (columns.size - 1) + "?)"+"""
ON CONFLICT (id)
DO UPDATE SET """ + column_name + """= CAST (? AS _int4), count_win=?, occurrences=?, "sumOccurrences"=?, win_rate=? Where tb.id=?;
""")