-
Notifications
You must be signed in to change notification settings - Fork 18
/
2nd char of ip1 and last 2nd char of ip2 show be equal.cs
53 lines (50 loc) · 1.49 KB
/
2nd char of ip1 and last 2nd char of ip2 show be equal.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
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication147
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the first string:");
string a = Console.ReadLine();
Console.WriteLine("Enter the second string:");
string b = Console.ReadLine();
char[] a1 = a.ToCharArray();
char[] b1 = b.ToCharArray();
int L1 = a1.Length;
int L2 = b1.Length;
int i, j;
for (i = 0; i < L1; i++)
{
for (j = 0; j < L2; j++)
{
if (i == 1 && j == 3)
{
if ((int)a1[i] >= 65 && (int)a1[i] <= 90)
{
a1[i] = (char)(a1[i] + 32);
}
else if ((int)a1[i] >= 97 && (int)a1[i] <= 122)
{
a1[i] = (char)(a1[i] - 32);
}
if (a1[i] == b1[j])
{
Console.WriteLine("true");
break;
}
}
else
{
continue;
}
}
}
Console.ReadLine();
}
}
}