-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA. Caps Lock.cs
39 lines (34 loc) · 964 Bytes
/
A. Caps Lock.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
int length = int.Parse(Console.ReadLine());
int currentMax = 0;
int max = 0;
String currentUser = "";
String lastUser = "";
for (int i = 0; i < length; i++)
{
String[] repost = Console.ReadLine().Split();
currentUser = repost[2].ToLower();
if (currentUser == lastUser)
{
currentMax++;
if (currentMax > max)
max = currentMax;
}
else
currentMax = 0;
lastUser = repost[0].ToLower();
}
Console.WriteLine(max + 2);
Console.ReadLine();
}
}
}