Editorial for Đầu cũng như cuối


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
void solve()
{
    char s1[100];
    scanf("%s", s1);
    int giua = strlen(s1)/2, check = 1, id= strlen(s1)-1;
    for(int i = 0; i < giua; i++){
        if(id < i ) break;
        if(s1[i] != s1[id]){
            check = 0; break;
        }
        id--;
    }
    if(check == 1){
        printf("YES");
    }else printf("NO");
 }

Comments

Please read the guidelines before commenting.


There are no comments at the moment.