求助
查看原帖
求助
693278
YuanHaoYu6315楼主2023/8/7 09:19
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s,t = "";
    cin >> s;
    int ansc = 1,ansf = 1;
    for(int i = 0;i < s.size();i++){
        if(s[i] == 'C'&&ansc == 1){
            t += "C";
            ansc++;
        }
        if(s[i] == 'F'&&ansf == 1){
            t+="F";
            ansf++;
        }
    }
    if(t == "CF"){
    	cout << "Yes"<<endl;
    }
    else{
    	cout <<"No"<<endl;
    }
}
2023/8/7 09:19
加载中...