小编Var*_*yay的帖子

为什么会出现"无效的文字错误"?

我在IDE中得到了正确的答案,但在线评判给出了以下错误:

Traceback (most recent call last):
  File "/tmp/editor_trsource_1410281976_804149.py", line 10, in 
    n=int(raw_input(''))
ValueError: invalid literal for int() with base 10: '100 10'
Run Code Online (Sandbox Code Playgroud)

问题链接:http://www.hackerearth.com/problem/golf/minimal-combinatorial/

def fact(x):
    f=1
    while x>0:
        f=f*x
        x-=1
    return f
T=int(raw_input(''))
while T>0:
    n=int(raw_input(''))
    r=int(raw_input(''))
    ans=fact(n)/(fact(r)*fact(n-r))
    print str(ans) + "\n"

    T-=1
Run Code Online (Sandbox Code Playgroud)

python

0
推荐指数
1
解决办法
327
查看次数

标签 统计

python ×1