SHARE
TWEET

Untitled

a guest Aug 26th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '''输入描述:
  2. 输入数据有多组,每组包含一个字符串s,且保证: 1 <= s.length <= 1000.
  3. 输出描述:
  4. 对于每组数据,输出移位后的字符串。
  5. 输入例子1:
  6. AkleBiCeilD
  7. 输出例子1:
  8. kleieilABCD'''
  9.  
  10. #字符串转列表
  11. string1=input()
  12. string=[]
  13. for i in range(len(string1)):
  14.     string.append(string1[i])
  15.  
  16. def sort(string):
  17.     #ASCII:a-z:97-122.A-Z:65-90
  18.     #大写字母个数num
  19.     num=0
  20.     for i in range(0,len(string)):
  21.         if 65<=ord(string[i])<=90:
  22.             num+=1
  23.  
  24.     #判断是否排序结束,count1表示有count1个大写字母已经排到了列表最后,count2表示有count2个小写字母排到了列表最前
  25.     try:
  26.         count1=0
  27.         count2=0
  28.         for i in range(0,num):
  29.             if 65<=ord(string[len(string)-i])<=90:
  30.                 count1+=1
  31.             if count1==num:
  32.                 return string
  33.         for i in range(0,len()):
  34.             if 97<=ord(string[i])<=122:
  35.                 count2+=1
  36.             else:
  37.                 break
  38.  
  39.         for j in range(count2,len(string)-count1-2):
  40.             if
  41.     except:
  42.         breakpoint()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top