distributed-computing/tasks/ostrovskaya-sf/lab_2/worker-2/Program.cs

14 lines
444 B
C#
Raw Permalink Normal View History

2023-10-10 16:55:06 +04:00
using System;
using System.IO;
2023-10-17 10:35:30 +04:00
using System.Linq;
2023-10-10 16:55:06 +04:00
2023-10-17 10:35:30 +04:00
string[] lines = File.ReadAllLines("/var/data/data.txt");
2023-10-10 16:55:06 +04:00
2023-10-17 10:35:30 +04:00
int multiplication = Convert.ToInt32(lines.First()) * Convert.ToInt32(lines.Last());
2023-10-10 16:55:06 +04:00
2023-10-17 10:35:30 +04:00
using (StreamWriter writer = new StreamWriter("/var/result/result.txt"))
2023-10-10 16:55:06 +04:00
{
writer.WriteLine(multiplication);
}
Console.WriteLine("Произведение успешно записано в файл! Результат: " + multiplication);