3 solutions

  • 2
    @ 2024-6-10 15:38:58
    #include<bits/stdc++.h>
    using namespace std;
    string s;
    int main(){
    	cin>>s;
    	for(int i=0;i<s.size();i++){
    		if(s[i]=='6') s[i]='9';
    		else if(s[i]=='9') s[i]='6';
    	} 
    	for(int i=s.size()-1;i>=0;i--) cout<<s[i];
    	cout<<"\n";
    	return 0;
    }
    

    啊这

    • 2
      @ 2024-3-2 16:37:57
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	string s;
      	cin>>s;
      	int siz=s.length();
      	for(int i=0;i<siz/2;i++){
      		swap(s[i],s[siz-i-1]);
      	}
      	for(int i=0;i<siz;i++){
      		if(s[i]=='6'){
      			s[i]='9';
      		}
      		else if(s[i]=='9'){
      			s[i]='6';
      		}
      	}
      	cout<<s;
      	return 0;
      }
      
      • 1
        @ 2024-3-30 18:06:15
        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	string s;cin>>s;
        	int siz=s.length();
        	for(int i=0;i<siz/2;i++) swap(s[i],s[siz-i-1]);
        	for(int i=0;i<siz;i++){
        		if(s[i]=='6') s[i]='9';
        		else if(s[i]=='9') s[i]='6';	}
        	cout<<s;
        	return 0;
        }
        
        • 1

        Information

        ID
        1004
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        7
        Tags
        (None)
        # Submissions
        190
        Accepted
        48
        Uploaded By