4 条题解

  • 0
    @ 2025-3-29 14:14:51
    #include<cstring>
    using namespace std;
    string s;
    int main(){
    	cin>>s;
    	int len=s.size();
    	int len1=len;
    	for(int i=0; i<len/2; i++)
    	{
    		if(s[i]!=s[len1-1])
    		{
    			cout<<"no";
    			return 0;
    		}
    		len1--;
    	 }
    	 cout<<"yes";
    	 return 0;
    }
    
    
    • 0
      @ 2025-3-29 14:04:07
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	string s;
      	getline ( cin, s );
      	int len =s.size();
      	int i = 0,j = len -1;
      	while(j>i)
      	{
      		if ( s[j]!=s[i] )
      		{
      			cout<<"no"<<endl;
      			return 0;
      		 } 
      		 i++;
      		 j--;
      	}
      	
      	
      	
      	
      	cout<<"yes"<<endl;
      	
      	
      	return 0;
       }
      • 0
        @ 2025-2-21 10:02:15
        using namespace std;
        int main()
        {
        	string s;
        	getline ( cin, s );
        	int len =s.size();
        	int i = 0,j = len -1;
        	while(j>i)
        	{
        		if ( s[j]!=s[i] )
        		{
        			cout<<"no"<<endl;
        			return 0;
        		 } 
        		 i++;
        		 j--;
        	}
        	
        	
        	
        	
        	cout<<"yes"<<endl;
        	
        	
        	return 0;
         }
        
        
        • 0
          @ 2024-7-21 14:12:13

          #include<bits/stdc++.h> using namespace std; string s; int main(){ string a,b; cin>>s; for(int i=0;i<s.size();i++){ a+=s[i]; } for(int i=s.size()-1;i>=0;i--){ b+=s[i]; } if(a==b){ cout<<"yes"; } else cout<<"no"; return 0; }

          • 1

          信息

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