This commit is contained in:
Fengyi Chen
2024-05-14 22:28:09 +08:00
parent 4d5ff00243
commit 4b8c0c58eb
11 changed files with 298 additions and 11 deletions

View File

@ -0,0 +1,21 @@
#include <iostream>
#include <cstdio>
#define int long long
using namespace std;
signed main()
{
char a[1005];
scanf("%[^\n]", &a);
int i = 0, cnt = 0;
while(a[i] != '\0')
{
if(((a[i] == 'A' && a[i + 1] == 'C') || a[i] == a[i + 1]) && a[i] != ' ')
{
cnt ++ ;
}
i ++ ;
}
cout << cnt ;
return 0;
}