在IDE上运行是对的,为什么RE了???

P5705 【深基2.例7】数字反转

little_q_exist @ 2024-08-18 19:27:02

python```

num_list = []
num = str(input())
for i in range(len(num)):
    num_list.append(num[i])
num_list.remove(".")
num_list.reverse()
num_list = list(map(int, num_list))
rev_num = num_list[0] + num_list[1]*0.1 + num_list[2]*0.01 + num_list[3]*0.001
print(float(rev_num))

by zhaoyikuan @ 2024-08-19 15:46:24

v = input().split('.') v[0] = int(v[0]) print(str(int(v[1]))+'.'+str(v[0]%10)+str(v[0]//10%10)+str(v[0]//100))
@little_q_exist 写这个AC 记录


by zhaoyikuan @ 2024-08-19 15:47:30


v = input().split('.')
v[0] = int(v[0])
print(str(int(v[1]))+'.'+str(v[0]%10)+str(v[0]//10%10)+str(v[0]//100))

sorry代码没成功发出来


by zhaoyikuan @ 2024-08-19 15:49:23

因为这个数小于100大于等于100,所以只需要考虑三位数


by little_q_exist @ 2024-08-19 22:07:56

@zhaoyikuan 蟹蟹大佬!


|