这题没有spj, 用python会wa @

a, b = map(float, input().split())
print(a % b)

2 条评论

  • @ 2025-4-17 18:49:03

    破案了!!
    就是oj的问题
    在一本通官网提交是对的!!

    • @ 2025-4-17 18:41:06

      严重怀疑是oj的问题!!
      下面的代码在gpt的帮助下并且我测试了都是对的

      a, b = input().split()
      la = len(a.split(".")[1])
      lb = len(b.split(".")[1])
      a = float(a)
      b = float(b)
      lr = max(la, lb)
      
      import math
      remainder = math.fmod(a, b)
      
      print(f"{remainder:.{lr}f}")
      
      
      • 1

      信息

      ID
      51
      时间
      1000ms
      内存
      256MiB
      难度
      10
      标签
      递交数
      9004
      已通过
      21
      上传者