计蒜客:Cryptographer's Conundrum

题目来源: https://www.jisuanke.com/contest/1410/85286

这题没啥好说的

#include<algorithm>
#include<iostream>
#define eps 1e-9
#define LL long long
#define PI acos(-1.0)
#define bitnum(a) __builtin_popcount(a)
using namespace std;
const int N = 305;
const int M = 100005;
const int inf = 1000000007;
const int mod = 10007;
char s[N],ch[5]="PER";
int main()
{
    int i,ans;
    while(~scanf("%s",s))
    {
        ans=0;
        for(i=0;s[i]!='\0';i++)
            if(s[i]!=ch[i%3])
                ans++;
        printf("%d\n",ans);
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/xyqqwer/article/details/81223292