diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index b0e38ab..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": {} -} \ No newline at end of file diff --git a/tasks/ostrovskaya-sf/lab_2/worker-1/Program.cs b/tasks/ostrovskaya-sf/lab_2/worker-1/Program.cs index 732f173..716a34c 100644 --- a/tasks/ostrovskaya-sf/lab_2/worker-1/Program.cs +++ b/tasks/ostrovskaya-sf/lab_2/worker-1/Program.cs @@ -2,11 +2,11 @@ using System.IO; using System.Net.Http; -var dir = new DirectoryInfo("../var/data"); +var dir = new DirectoryInfo("/var/data"); var files = dir.GetFiles(); -string resultFilePath = "../var/result/data.txt"; +string resultFilePath = "/var/result/data.txt"; try { int[] mass = new int[files.Length]; diff --git a/tasks/ostrovskaya-sf/lab_2/worker-2/Program.cs b/tasks/ostrovskaya-sf/lab_2/worker-2/Program.cs index e11b7c1..f78f1ec 100644 --- a/tasks/ostrovskaya-sf/lab_2/worker-2/Program.cs +++ b/tasks/ostrovskaya-sf/lab_2/worker-2/Program.cs @@ -1,32 +1,12 @@ using System; using System.IO; +using System.Linq; -string[] lines = File.ReadAllLines("../var/data/data.txt"); +string[] lines = File.ReadAllLines("/var/data/data.txt"); -int firstNumber = 0; -int lastNumber = 0; +int multiplication = Convert.ToInt32(lines.First()) * Convert.ToInt32(lines.Last()); -foreach (string line in lines) -{ - if (int.TryParse(line, out int number)) - { - firstNumber = number; - break; - } -} - -for (int i = lines.Length - 1; i >= 0; i--) -{ - if (int.TryParse(lines[i], out int number)) - { - lastNumber = number; - break; - } -} - -int multiplication = firstNumber * lastNumber; - -using (StreamWriter writer = new StreamWriter("../var/result/result.txt")) +using (StreamWriter writer = new StreamWriter("/var/result/result.txt")) { writer.WriteLine(multiplication); }