7 条题解

  • 2
    @ 2024-7-21 13:38:54
    #include <bits/stdc++.h> 
    using namespace std; 
    string s; 
    int main(){ 
    	getline(cin,s); 
    	for(int i=0;i<s.size();i++)
    	{ 
    		if(s[i]>='A' and s[i]<='Z'){ 
    		s[i]++; 
    		}
    		else if(s[i]>='a' and s[i]<='z')
    		{ 
    			s[i]++; 
    		} 
    		} cout<<s; 
    		return 0; 
    } 
    
    
    • 2
      @ 2024-7-21 13:38:39
      #include<bits/stdc++.h>
      using namespace std;
      string s; 
      int main(){
      	getline(cin,s);
      	for(int i=0;i<=s.size();i++){
      		if(s[i]<='y'&&s[i]>='a'||s[i]<='Y'&&s[i]>='A'){
      			s[i]+=1;
      		}else{
      			if(s[i]=='Z'||s[i]=='z'){
      				s[i]-=25;
      			}
      		}
      	}
      	cout<<s;
      	return 0;
      }
      
      • 1
        @ 2024-7-21 11:27:28

        #include <bits/stdc++.h> using namespace std; string s; int main(){ getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]>='A' and s[i]<='Z'){ s[i]++; }else if(s[i]>='a' and s[i]<='z'){ s[i]++; } } cout<<s; return 0; } //AC的

        • 0
          @ 2024-7-21 11:59:10

          #include<bits/stdc++.h> using namespace std; string s; int main(){ getline(cin,s); for(int i=0;i<s.size();i++){ if('a'<=s[i] and s[i]<='y' or 'A'<=s[i] and s[i]<='Y') { s[i]+=1; }else if('z'==s[i] or 'Z'==s[i]){ s[i]-=25; } } cout<<s; return 0; }

          • 0
            @ 2024-7-21 11:50:13

            #include <bits/stdc++.h> using namespace std; string s; int main(){ getline(cin,s); for(int i=0;i<s.size();i++){ if('a' <= s[i] and s[i] <= 'y' or 'A' <= s[i] and s[i] <= 'Y'){ s[i] = s[i]+1; }else if('z' == s[i]){ s[i] = 'a'; }else if('Z' == s[i]){ s[i] = 'A'; } } cout<<s; return 0; }1.

            • -2
              @ 2024-7-21 11:08:32

              #include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]>='a'&&s[i]<='y'||s[i]>='A'&&s[i]<='Y'){ s[i]=s[i]+1; } else if(s[i]'z'||s[i]'Z'){ s[i]=s[i]-25; } } cout<<s; return 0; }

              • 1

              信息

              ID
              1301
              时间
              1000ms
              内存
              128MiB
              难度
              4
              标签
              (无)
              递交数
              240
              已通过
              119
              上传者