-
-
Notifications
You must be signed in to change notification settings - Fork 414
/
Copy pathsolution.cs
26 lines (23 loc) · 803 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
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp1 {
class Program {
static void Main(string[] args) {
string input = new string(args[0].OrderBy(c => c).ToArray());
string lower = "", upper = "", even = "", odd = "";
for (int i = 0; i < input.Length; i++) {
if (Char.IsLower(input[i])) {
lower += input[i];
} else if (Char.IsUpper(input[i])) {
upper += input[i];
} else if (Char.GetNumericValue(input[i]) % 2 == 0) {
even += input[i];
} else {
odd += input[i];
}
}
Console.WriteLine(lower + upper + even + odd);
}
}
}