2 条题解

  • 0
    @ 2025-9-12 13:44:45
    s=input()
    print(chr(ord(s[0])+4)+chr(ord(s[1])+4)+chr(ord(s[2])+4)+chr(ord(s[3])+4)+chr(ord(s[4])+4))
    
    • 0
      @ 2025-4-4 11:52:33
      def encrypt(text):
          encrypted_text = ""
          for char in text:
              # 计算加密后的字符,注意处理字母表的循环
              if 'a' <= char <= 'z':
                  new_char = chr(((ord(char) - ord('a') + 4) % 26) + ord('a'))
              elif 'A' <= char <= 'Z':
                  new_char = chr(((ord(char) - ord('A') + 4) % 26) + ord('A'))
              else:
                  new_char = char
              encrypted_text += new_char
          return encrypted_text
      
      # 输入字符串
      input_text = input()
      # 输出加密后的字符串
      output_text = encrypt(input_text)
      print(output_text)  # 输出: Glmre
      
      • 1

      信息

      ID
      516
      时间
      1000ms
      内存
      64MiB
      难度
      6
      标签
      递交数
      113
      已通过
      37
      上传者