-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA. Magnets.cs
40 lines (34 loc) · 905 Bytes
/
A. Magnets.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
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication16
{
class Program
{
static void Main(string[] args)
{
var line1 = Console.ReadLine();
var line2 = Console.ReadLine();
var str = new StringBuilder();
for (int i = 0; i < line1.Length; i++)
{
if (line1[i] != line2[i])
str.Append('1');
else
str.Append('0');
}
Console.WriteLine(str.ToString());
Console.ReadLine();
}
public static bool isSorted (List<int> numbers)
{
for (int i = 1; i < numbers.Count; i ++)
{
if (numbers[i] < numbers[i - 1])
return false;
}
return true;
}
}
}