Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
v3
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string left =""; string right =""; string temp =""; int num; string str5 = ""; string str6 = ""; string st1 = ""; string st2 = ""; string st3 = ""; int num2 = 0; string str = "ABCDEFGHIJKLMNOPQRSTUVWXY"; //MAIN INPUT STRING WE PROVIDE string str2 = str.Substring(0, 3) + str.Substring(5, 2) + str.Substring(8, 1) + str.Substring(13, 3) + str.Substring(0x12, 1); string str3 = str.Substring(3, 2) + str.Substring(7, 1) + str.Substring(9, 4) + str.Substring(0x10, 2) + str.Substring(0x13, 1); string str4 = str.Substring(str.Length - 5, 5); if (str4.Substring(0, 1) != str2.Substring(4, 1)) { // if program comes here then Input string is not valid } if (str4.Substring(1, 1) != str3.Substring(0, 1)) { // if program comes here then Input string is not valid } if (str4.Substring(str4.Length - 1, 1) != str2.Substring(0, 1)) { // if program comes here then Input string is not valid } for (num = 0; num < str3.Length; num++) { str5 = str5 + Convert.ToString((int) (Convert.ToChar(str3.Substring(num, 1)) - '0')).Substring(Convert.ToString((int) (Convert.ToChar(str3.Substring(num, 1)) - '0')).Length - 1, 1); } for (num = 0; num < str2.Length; num++) { str6 = str6 + Convert.ToString((int) Convert.ToChar(str2.Substring(num, 1))).Substring(Convert.ToString((int) Convert.ToChar(str2.Substring(num, 1))).Length - 1, 1); } if (str5 != str6) { // if program comes here then Input string is not valid } int num3 = 0; string str12 = ""; for (num = 0; num < str3.Length; num++) { num3 = Convert.ToChar(str3.Substring(num, 1)); str12 = Convert.ToString((int) (Convert.ToChar(str3.Substring(num, 1)) - '0')).Substring(Convert.ToString((int) (Convert.ToChar(str3.Substring(num, 1)) - '0')).Length - 1, 1); num2 += Convert.ToInt32(str12); } str5 = num2.ToString(); str4 = str4.Substring(2, 2); str4 = Convert.ToString((int) (Convert.ToChar(str4.Substring(0, 1)) - '0')).Substring(Convert.ToString((int) (Convert.ToChar(str4.Substring(0, 1)) - '0')).Length - 1, 1) + Convert.ToString((int) (Convert.ToChar(str4.Substring(1, 1)) - '0')).Substring(Convert.ToString((int) (Convert.ToChar(str4.Substring(1, 1)) - '0')).Length - 1, 1); if (str5 != str4) { // if program comes here then Input string is not valid } //final place. //If can come here without any input string error, then input string is valid } } }
run
|
edit
|
history
|
help
0
RNJHEFDSS VASX
DateTime Parser
2. Basic types: List
Student Cables
Contraseña final
z
sdfrgthyuyt dsxcsd
Fórum ➡ Example of a "crippled" extension method ♦
Store reference to a object
BankAccount