diff --git a/.vs/comivoyar/v15/.suo b/.vs/comivoyar/v15/.suo index 761631a..066d4d7 100644 Binary files a/.vs/comivoyar/v15/.suo and b/.vs/comivoyar/v15/.suo differ diff --git a/.vs/comivoyar/v15/Server/sqlite3/storage.ide b/.vs/comivoyar/v15/Server/sqlite3/storage.ide index 17be4f6..e05a02c 100644 Binary files a/.vs/comivoyar/v15/Server/sqlite3/storage.ide and b/.vs/comivoyar/v15/Server/sqlite3/storage.ide differ diff --git a/1.bmp b/1.bmp deleted file mode 100644 index 1fcac58..0000000 Binary files a/1.bmp and /dev/null differ diff --git a/comivoyar/Program.cs b/comivoyar/Program.cs index 74d58ef..5a567f3 100644 --- a/comivoyar/Program.cs +++ b/comivoyar/Program.cs @@ -1,9 +1,9 @@ using System; -using System.IO; using System.Diagnostics; using Combinatorics.Collections; using System.Collections.Generic; using static System.Console; +using System.Threading.Tasks; namespace komvo { @@ -15,9 +15,19 @@ namespace komvo List Points = new List(); Random random = new Random(); - int pCount; + int pCount = 0; Write("Введите количество точек: "); - pCount = Convert.ToInt32(ReadLine()); + + Retry: + try + { + pCount = Convert.ToInt32(ReadLine()); + } + catch + { + Write("Введите натуральное число: "); + goto Retry; + } Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); @@ -44,10 +54,8 @@ namespace komvo for (int j = 0; j < matr; j++) Write("{0:00.00} ", Matrix[i, j]); WriteLine(); } - int[] toSwap = new int[Points.Count - 1]; for (int i = 0; i <= toSwap.Length - 1; i++) toSwap[i] = i + 2; - //for (int i = 0; i < toSwap.Length; i++) Write(toSwap[i]); //debug int index = 0; double opLength = 0, prevResult = 0; @@ -78,10 +86,11 @@ namespace komvo stopwatch.Stop(); Write("Ещё раз? (y/n)"); - char answer = Convert.ToChar(ReadLine()); + char answer = ReadKey().KeyChar; if (answer == 'y') { Points.Clear(); + WriteLine("\n"); goto Beginig; } } @@ -93,8 +102,6 @@ namespace komvo for (int j = 0; j < index.Length - 1; j++) { - string dg = index[j]; - int db = int.Parse(index[j]) - 2; //debug if (j == 0) result += mtr[0, int.Parse(index[j]) - 1]; else if (j == index.Length - 1) { diff --git a/comivoyar/bin/Debug/comivoyar.exe b/comivoyar/bin/Debug/comivoyar.exe index 02b54f5..3e29095 100644 Binary files a/comivoyar/bin/Debug/comivoyar.exe and b/comivoyar/bin/Debug/comivoyar.exe differ diff --git a/comivoyar/bin/Debug/comivoyar.pdb b/comivoyar/bin/Debug/comivoyar.pdb index a7e2523..f00be1a 100644 Binary files a/comivoyar/bin/Debug/comivoyar.pdb and b/comivoyar/bin/Debug/comivoyar.pdb differ diff --git a/comivoyar/obj/Debug/comivoyar.exe b/comivoyar/obj/Debug/comivoyar.exe index 02b54f5..3e29095 100644 Binary files a/comivoyar/obj/Debug/comivoyar.exe and b/comivoyar/obj/Debug/comivoyar.exe differ diff --git a/comivoyar/obj/Debug/comivoyar.pdb b/comivoyar/obj/Debug/comivoyar.pdb index a7e2523..f00be1a 100644 Binary files a/comivoyar/obj/Debug/comivoyar.pdb and b/comivoyar/obj/Debug/comivoyar.pdb differ