2 条题解

  • 0
    @ 2023-11-11 19:33:51

    反正变量名可以是中文,那作为一个中国人,变量名用中文不过分吧?

    加密口令=list(input())
    明码口令=''
    for i in 加密口令:
        if(i>='a' and i<='j'):
            明码口令+=str(chr(ord(i)-ord('a')+ord('0')))
        elif(i>='0' and i<='9'):
            明码口令+=str(chr(ord(i)-ord('0')+ord('a')))
        elif(i>='k' and i<='r'):
            明码口令+=str(chr(ord('z')-(ord(i)-ord('k'))))
        elif(i>='s' and i<='z'):
            明码口令+=str(chr(ord('k')+(ord('z')-ord(i))))
    print(明码口令)
    
    • 0
      @ 2022-9-24 22:04:06

      循环太复杂,宁愿写多亿点

      minwen = [0,1,2,3,4,5,6,7,8,9,]
      n = input()
      m = []
      for i in n:
          m.append(i)
      
      for i in range(len(m)):
          p = m[i]
          if p == '0':
              m[i] = 'a'
              continue
          elif p == '1':
              m[i] = 'b'
              continue
          elif p == '2':
              m[i] = 'c'
              continue
          elif p == '3':
              m[i] = 'd'
              continue
          elif p == '4':
              m[i] = 'e'
              continue
          elif p == '5':
              m[i] = 'f'
              continue
          elif p == '6':
              m[i] = 'g'
              continue
          elif p == '7':
              m[i] = 'h'
              continue
          elif p == '8':
              m[i] = 'i'
              continue
          elif p == '9':
              m[i] = 'j'
              continue
          elif p == 'k':
              m[i] = 'z'
              continue
          elif p == 'l':
              m[i] = 'y'
              continue
          elif p == 'm':
              m[i] = 'x'
              continue
          elif p == 'n':
              m[i] = 'w'
              continue
          elif p == 'o':
              m[i] = 'v'
              continue
          elif p == 'p':
              m[i] = 'u'
              continue
          elif p == 'q':
              m[i] = 't'
              continue
          elif p == 'r':
              m[i] = 's'
              continue
          elif p == 'a':
              m[i] = '0'
              continue
          elif p == 'b':
              m[i] = '1'
              continue
          elif p == 'c':
              m[i] = '2'
              continue
          elif p == 'd':
              m[i] = '3'
              continue
          elif p == 'e':
              m[i] = '4'
              continue
          elif p == 'f':
              m[i] = '5'
              continue
          elif p == 'g':
              m[i] = '6'
              continue
          elif p == 'h':
              m[i] = '7'
              continue
          elif p == 'i':
              m[i] = '8'
              continue
          elif p == 'j':
              m[i] = '9'
              continue
          elif p == 'z':
              m[i] = 'k'
              continue
          elif p == 'y':
              m[i] = 'l'
              continue
          elif p == 'x':
              m[i] = 'm'
              continue
          elif p == 'w':
              m[i] = 'n'
              continue
          elif p == 'v':
              m[i] = 'o'
              continue
          elif p == 'c':
              m[i] = 'p'
              continue
          elif p == 'u':
              m[i] = 'p'
              continue
          elif p == 't':
              m[i] = 'q'
              continue
          elif p == 's':
              m[i] = 'r'
              continue
      for i in range(len(m)):
          print(m[i],end='')
      

      100 Accepted

      # 状态 耗时 内存占用
      ------------------------------------
      #1 Accepted 25ms 3.1 MiB
      -
      #2 Accepted 25ms 3 MiB
      -
      #3 Accepted 24ms 3.1 MiB
      -
      #4 Accepted 26ms 3.1 MiB
      -
      #5 Accepted 22ms 3.1 MiB
      -
      #6 Accepted 28ms 3.1 MiB
      -
      #7 Accepted 26ms 3 MiB
      -
      #8 Accepted 24ms 3 MiB
      -
      #9 Accepted 26ms 3.1 MiB
      -
      #10 Accepted 21ms 3 MiB
      • 1

      信息

      ID
      1359
      时间
      1000ms
      内存
      128MiB
      难度
      5
      标签
      递交数
      23
      已通过
      14
      上传者