水题 CodeForces 137A Postcards and photos

时间:2022-03-09 17:17:27

题目传送门

 /*
水!
*/
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
char s[MAXN]; int main(void) //CodeForces 137A Postcards and photos
{
// freopen ("E.in", "r", stdin); while (scanf ("%s", s) == )
{
int len = strlen (s);
int ans = ; int i = ;
while (i < len)
{
char ch = s[i]; int cnt = ;
while (cnt < && i < len)
{
if (s[i+] == ch)
{
++cnt; ++i;
}
else break;
}
ans++; i++;
} printf ("%d\n", ans);
} return ;
}