-
Notifications
You must be signed in to change notification settings - Fork 6
/
Solution.cs
33 lines (26 loc) · 839 Bytes
/
Solution.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
using System;
class Solution {
static void Main(string[] args) {
int n = Convert.ToInt32(Console.ReadLine());
int[] scores = Array.ConvertAll(Console.ReadLine().Split(' '), scoresTemp => Convert.ToInt32(scoresTemp))
;
int highestScore = scores[0];
int lowestScore = scores[0];
int highestScoreCount = 0;
int lowestScoreCount = 0;
for(int i=0; i<n; i++)
{
if(highestScore < scores[i])
{
highestScore = scores[i];
highestScoreCount++;
}
else if(lowestScore > scores[i])
{
lowestScore = scores[i];
lowestScoreCount++;
}
}
Console.WriteLine(highestScoreCount +" "+ lowestScoreCount);
}
}