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

Posted dragondragon

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了思维+博弈论:字符串操作相关的知识,希望对你有一定的参考价值。

传送门: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;
    

  

以上是关于思维+博弈论:字符串操作的主要内容,如果未能解决你的问题,请参考以下文章