#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main()
{
int n;
int cnt = 0;
int lastt = -1;
int ans = 1;
cin >> n;
for (int i = 0; i < n ; i++)
{
int h, m, t;
string s, nouse1;
char nouse2;
cin >> nouse2 >> h >> nouse2 >> m >> s;
getline(cin, nouse1);
//getchar();
if (s == "a.m.]:")t = h * 60 + m;
else t = 720 + h * 60 + m;
if (lastt > t||cnt > 10)
{
ans++;
cnt = 0;
}
if (lastt == t)
{
cnt++;
}
else
{
cnt = 0;
}
lastt = t;
}
cout << ans;
return 0;
}
第14个点挂了!
救救我吧!!!
代码因该挺好理解的吧......