9 条题解

  • 1
    @ 2024-7-19 20:07:57
    s=input()
    ans=""
    for i in range(len(s)):
        if ord(s[i]) < ord('v') and ord(s[i]) >= ord('a'):
            ans+=chr(ord(s[i])+5)
        elif ord(s[i]) >= ord('a') and ord(s[i]) <= ord('z'):
            ans+=chr(ord(s[i])-26+5)
        else:
            ans+=s[i]
    print(ans)
    
    • 1
      @ 2023-7-17 19:39:02
      #include <iostream>
      #include <cstdio>
      #include<string>
      using namespace std;
      int main(){
          string str;
          getline(cin,str);
          for(int i=0;i<str.length();i++){
              if(str[i]>='a'&&str[i]<='u'){
                  str[i]+=5;
              }else if(str[i]>='v'&&str[i]<='z')
      		{
      			if(str[i]=='v')str[i]='a';
      			if(str[i]=='w')str[i]='b';
      			if(str[i]=='x')str[i]='c';
      			if(str[i]=='y')str[i]='d';
      			if(str[i]=='z')str[i]='e';
      		}
          }
          cout<<str;
          return 0;
      }
      

      c++

      • 1
        @ 2023-7-12 9:44:16
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	string s1;
        	getline(cin,s1);
        	for(int i=0;i<s1.length();i++)
        	{
        		if(int(s1[i])>=97&&int(s1[i])<=117)
        		{
        			s1[i]=char(int(s1[i])+5);
        		}
        		else if(s1[i]>='v'&&s1[i]<='z')
        		{
        			if(s1[i]=='v')s1[i]='a';
        			if(s1[i]=='w')s1[i]='b';
        			if(s1[i]=='x')s1[i]='c';
        			if(s1[i]=='y')s1[i]='d';
        			if(s1[i]=='z')s1[i]='e';
        		}
        	}
        	cout<<s1<<endl;
        	return 0;
        }
        
        • 0
          @ 2025-3-24 9:53:42

          #include <bits/stdc++.h>

          using namespace std; string s1,ans=""; int main() { getline(cin,s1); int n=s1.length(); for(int i=0;i<n;i++){ if(s1[i]>='a' and s1[i]<='z'){ int k=s1[i]-'a'; k=(k+5)%26; char c1='a'+k; ans=ans+c1; }else{ ans=ans+s1[i]; } } cout<<ans<<endl; return 0; }

          • 0
            @ 2025-3-24 9:52:04

            #include #include using namespace std; string s1,ans=""; int main() { getline (cin,s1); int n=s1.length(); for (int i=0;i<n;i++){ if(s1[i]>='a' and s1[i]<='z'){ int k=s1[i]-'a'; k=(k+5)%26; char c1='a'+k; ans=ans+c1; }else{ ans=ans+s1[i]; } } cout<<ans<<endl; return 0; }

            • 0
              @ 2024-7-12 20:09:52
              a=input()
              b=0
              c=""
              d=0
              for i in a:
                  if (i>="a" and i<="z") or (i>="A" and i<="Z") :
                      b=ord(i) 
                      d=b+5
                      if (d>90 and d<100) or (d>122 and d<130):
                          d=d-26
                      i=chr(d)
                  c+=i
              print(c)
              
              • 0
                @ 2023-8-13 12:04:49

                python的哦~

                a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
                abc={"a":1,"b":2,"c":3,"d":4,"e":5,"f":6,"g":7,"h":8,"i":9,"j":10,"k":11,"l":12,"m":13,"n":14,"o":15,"p":16,"q":17,"r":18,"s":19,"t":20,"u":21,"v":22,"w":23,"x":24,"y":25,"z":26}
                cba={1:"a",2:"b",3:"c",4:"d",5:"e",6:"f",7:"g",8:"h",9:"i",10:"j",11:"k",12:"l",13:"m",14:"n",15:"o",16:"p",17:"q",18:"r",19:"s",20:"t",21:"u",22:"v",23:"w",24:"x",25:"y",26:"z"}
                love=input()
                love_max=[]
                for i in love:
                    if i in a:
                        x=abc[i]
                        x+=5
                        if x>26:
                            x-=26
                        i=cba[x]        
                    love_max.append(i)
                love_super_max=""
                love_super_max="".join(love_max) # 语法:str.join(sequence)
                print(love_super_max)
                
                • 0
                  @ 2022-7-10 16:01:52
                  #include<bits/stdc++.h>
                  using namespace std;
                  int main() {
                  	int a,b,c;
                  	char d;
                  	cin>>noskipws;
                  	while(cin>>d) {
                  		c=(int)d;
                  		if(c<97||c>122)printf("%c",c);
                  		else if(c!=118&&c!=119&&c!=120&&c!=121&&c!=122)printf("%c",(c+5));
                  		else switch(c){
                  			case 118:cout<<'a';break;
                  			case 119:cout<<'b';break;
                  			case 120:cout<<'c';break;
                  			case 121:cout<<'d';break;
                  			case 122:cout<<'e';break;
                  		}
                  	}
                  }
                  
                  • -1
                    @ 2023-7-17 20:35:37

                    #include <bits/stdc++.h> using namespace std; int main() { string a; while (cin>>a){ int b=0; b=a.length(); if(b==10){ cout <<" "; } for (int i=0;i<b;i++){ if(a[i]>=97 and a[i]<=122) { if(a[i]>117){a[i]=a[i]-21;} else{a[i]=a[i]+5;} cout <<a[i]; }else{ cout<<a[i]; }

                    }
                        cout<<" ";
                    }
                    return 0;
                    

                    }

                    • 1

                    信息

                    ID
                    75
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    4
                    标签
                    递交数
                    1362
                    已通过
                    613
                    上传者