See the echo string for nyoj 752

Source: Internet
Author: User
See the receipt of the string time limit: 1000 MS | memory limit: 65535 kb difficulty: 2
Description

A text return string is a string with the same reading and deserialization. For example, "level" or "Noon" is a text return string. Today, piaoyi met another question about strings: two people play a game and give a string. The two take turns to delete any character in the string. When someone deletes the character, if the string can be reorganized and then is a return string, it wins. If they are smart enough to avoid Operation mistakes, can they win the first hand.

Input
Multiple groups of test data, enter a string (all strings must be less than 10000 or more than 1 and are all lowercase letters)
Output
If the first hand wins, the output is yes; otherwise, the output is no. Each group of output results occupies one row.
Sample Input
aabb
abc
Sample output
Yes
No
AC code:
#include<stdio.h>char str[10005];int main(){int i,count[26],num;while(~scanf("%s",str)){for(i=0;i<26;i++)count[i]=0;num=0;for(i=0;str[i]!='\0';i++){count[str[i]-'a']++;}for(i=0;i<26;i++){if(count[i]%2==1)num++;}if(num<=2)printf("Yes\n");else{printf("%s\n",num%2==1?"No":"Yes");}}return 0;}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.