1 条题解

  • 0
    @ 2024-12-20 13:05:40

    双指针

    #include<bits/stdc++.h>

    using namespace std;

    char a[1000];

    int main()

    {

    cin.getline(a,1000);
    
    int s=strlen(a),r=0,l=s-1;
    
    while(r<l)
    
    {
    
    	if(a[r++]==a[l--])
    
    	{
    
    		cout<<"yes";
    
    		return 0;
    
    	}
    
    	else
    
    	{
    
    		cout<<"no";
    
    		return 0;
    
    	}
    
    }
    
    return 0;
    

    }

    信息

    ID
    186
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    3
    已通过
    3
    上传者