全部RE了aaa (python

P1591 阶乘数码

_liu114514_ @ 2024-08-30 16:51:28

t=int(input())
while(t>0):
    n=int(input())
    a=int(input())
    r=1
    ans=0
    for i in range(1,n+1):
        r*=i
    while(n>0):
        t=n%10
        if t==a:
            ans+=1
    print(ans)
    print("\n")
    t-=1

by _liu114514_ @ 2024-08-30 16:53:14

这题试了三种语言了


by Eason20120229 @ 2024-08-30 17:01:54

@liuenrui input() 会读入整行,

n=int(input())
a=int(input())

应改为

n,a= [int(i) for i in input().split()]

by __yun__ @ 2024-08-30 17:08:48

@liuenrui
帮你改了所有错误

t=int(input())
while t>0:
    n,a=map(int,input().split())
    r=1
    ans=0
    for i in range(1,n+1):
        r*=i
    while r>0:
        if r%10==a:
            ans+=1
        r//=10
    print(ans)
    t-=1

by _liu114514_ @ 2024-08-31 07:58:06

@yun @Eason20120229 谢谢两位大佬orz


|