首页 > 其他 > 详细

codeforces-5

时间:2019-04-11 00:26:43      阅读:143      评论:0      收藏:0      [点我收藏+]

这题可害苦了我
最后用了大哥的代码才过的

Diverse String

#include<iostream>
#include<cstdio>
#include<string.h>
#include<algorithm>
using  namespace std;
int main()
{
    int T;
    string s;
    cin>>T;
    while(T--)
    {
        cin>>s;
        sort(s.begin(),s.end());
        bool flag=true;
        for(int i=1;i<s.size();i++)
        {
            if(s[i]!=s[i-1]+1){
                puts("NO");
                flag=false;
                break;
            }
        }
        if(flag)
            puts("Yes");
    }
    return 0;
}

codeforces-5

原文:https://www.cnblogs.com/WABoom/p/10687011.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!