我是java的新手,所以如果这听起来绝对愚蠢,请不要降价
好吧如何使用单个扫描仪对象输入此内容
五
你好,你怎么样
欢迎来到我的世界
6 7
对于那些建议的人
scannerobj.nextInt->nextLine->nextLine->nextInt->nextInt,,,
Run Code Online (Sandbox Code Playgroud)
检查出来,它不起作用!
谢谢
我已将变量fiblist声明为全局变量,但它在gen10fib中获得None的值.
# Enter your code here. Read input from STDIN. Print output to STDOUT
#program to check if a number is fibonacci number
global fiblist
fiblist=[0,1] #list to store generated fibonacci numbers
global Nlist
Nlist=[] # list for T test cases
global solnList
solnList=[] #contains the solution 1 is fibo 0 not fibo
global head
head=1 #to denote the maximum element in the list
def comparator(fiblist,x,head):
if(head<x):
gen10fib(fiblist) #generates the next 10 numbers of fibonacci sequence and appends them to …Run Code Online (Sandbox Code Playgroud)