#37607: Python 1行解


s811635@whsh.tc.edu.tw (min)

School : 國立中興大學
ID : 104560
IP address : [1.168.130.249]
Last Login :
2024-05-05 02:09:35
a021. 大數運算 | From: [111.83.101.2] | Post Date : 2023-09-19 16:13

print(eval(input().replace('/','//')))
 
#39720: Re: Python 1行解


316829316829316828z@gmail.com (WA&TLE為AC之母)

School : No School
ID : 267947
IP address : [61.216.106.5]
Last Login :
2024-05-16 11:40:14
a021. 大數運算 | From: [61.224.158.15] | Post Date : 2024-03-22 21:37

print(eval(input().replace('/','//')))


eval被ban了

 
#39887: Re: Python 1行解


badonkadooonkmc@gmail.com (BlueW)

School : 國立員林高級中學
ID : 269763
IP address : [106.105.44.160]
Last Login :
2024-07-04 18:01:23
a021. 大數運算 | From: [36.232.56.245] | Post Date : 2024-04-09 15:25

print(eval(input().replace('/','//')))


eval被ban了

 

兩行解
a,b,c = input().split(" ")
print((int(a)+int(c)) if (b=="+") else ((int(a)-int(c)) if (b == "-") else ((int(a)*int(c)) if (b == "*") else(int(a)//int(c)))))
 
ZeroJudge Forum