码迷,mamicode.com
首页 > 其他好文 > 详细

思维+博弈论:字符串操作

时间:2019-08-19 23:05:12      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:span   stream   ble   ++   mes   for   main   ios   length   

传送门:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=856

#include<iostream>
using namespace std;
int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        string a;
        cin>>a;
        int len=a.length();
        int b;
        for(int i=0;i<len;i++)
        {
            if(a[i]==‘y‘)
            {
                continue;
            }
            else
            {
                b=i;
                break;
            }
        }
        if(a[b]==‘z‘)
        {
            a[b]=‘b‘;
        }
        cout<<a<<endl;
    }
}

  

思维+博弈论:字符串操作

标签:span   stream   ble   ++   mes   for   main   ios   length   

原文地址:https://www.cnblogs.com/dragondragon/p/11380140.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!