2 条题解

  • 1
    @ 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
      难度
      3
      标签
      (无)
      递交数
      52
      已通过
      30
      上传者