这题我有一点点不会,就是遍历读取字符串,需要各位大佬帮忙,栓Q
#include<bits/stdc++.h>
using namespace std;
void F(long long &x) {
x ^= x & (x << 3);
x ^= x & (x >> 2);
x %= 65536;
}void G(long long &x) {
x ^= x & (x << 2);
x ^= x & (x >> 3);
x %= 65536;
}int main(){
string s;
long long x;
cin>>s>>x;
for(int i=0;i<s.size();i++){
if(s[i]=="F"){
F(x);
}else{
G(x);
}
}
cout<<x;
}