我还是不喜欢废话,Python实现就是简单,那就用Python吧(暂时),后面找到工作了,再钻研一下C/C++。
-
比如下面这个输入:
第一行:4 3.0
第二行:2 3 4 5
不用写函数,直接用脚本:n1, n2 = input().split() n_list = map(int, input().split())
-
如果都是同一个类型的比如int
第一行:4 3
第二行:2 3 4 5
那么读取的脚本为:
number = []
for i in range(2):
number.append(map(int, input().split()))
number[0] # first line
number[1] # second line
打赏作者