ACM寒假集训2019.1.22
程序员文章站
2024-03-20 13:34:04
...
题目链接:https://vjudge.net/contest/279625#problem/C
代码:
#include <iostream>
using namespace std;
int main()
{
int n,sum=1;
cin >> n;
if (n < 1 || n>100000)
return 0;
n++;
char(*a)[2] = new char[n][2];
n--;
for (int i = 0; i < n; i++)
cin >> a[i][1] >> a[i][2];
for (int i = 0; i < n-1;i++)
{
if (a[i][2] == a[i + 1][1])
sum++;
}
cout << sum;
}
上一篇: cookies
下一篇: ACM寒假集训2019.1.23