2 条题解

  • 1
    @ 2025-3-15 18:55:42
    m = int(input())
    a = m//3600
    b = m%3600//60
    c = m%60
    h = ""
    min = ""
    s = ""
    if a<10:
        h = "0"+str(a)
    else:
        h = str(a)
    
    if b<10:
        min = "0"+str(b)
    else:
        min = str(b)
    
    if c<10:
        s = "0"+str(c)
    else:
        s = str(c)
    print(h+":"+min+":"+s)
    

    直接无脑

    • 0
      @ 2025-4-4 20:29:10
      def convert_seconds_to_time(seconds):
          # 计算小时、分钟和秒
          hours = seconds // 3600
          minutes = (seconds % 3600) // 60
          secs = seconds % 60
          time_str = f"{hours:02}:{minutes:02}:{secs:02}"
          return time_str
      
      
      input_seconds = int(input())
      output_time = convert_seconds_to_time(input_seconds)
      print(output_time) 
      
      • 1

      信息

      ID
      560
      时间
      1000ms
      内存
      64MiB
      难度
      1
      标签
      递交数
      35
      已通过
      27
      上传者