在C中我们可以这样做:
// Reads two values in one line
scanf("%d %d", &x, &y)
一种解决方案是使用raw_input()两次。
x, y = raw_input(), raw_input()
请注意,我们不必显式指定split(''),因为split()使用任何空白字符作为分隔符作为默认值。
在上面的Python代码中要注意的一点是,x和y都是字符串。我们可以使用另一行将它们转换为int
下面是完整的一行代码,使用split和list comprehension从标准输入读取两个整数变量
# Reads two numbers from input and typecasts them to int using
# list comprehension
x, y = [int(x) for x in raw_input().split()]
# Reads two numbers from input and typecasts them to int using
# map function
x, y = map(int, raw_input().split())
三个资料Q群下载不了也转发不了,先放这里Fine_tuning.zipLangChain.zipdata_clear.rar