Андрей Морозов 2 лет назад
Родитель
Сommit
c788d9b5f0
2 измененных файлов с 11 добавлено и 3 удалено
  1. 10 3
      Exam/Program.cs
  2. 1 0
      Exam/ReadData.cs

+ 10 - 3
Exam/Program.cs

@@ -18,11 +18,18 @@ namespace Exam
         {
         {
             Tubes[] tube = new Tubes[0];
             Tubes[] tube = new Tubes[0];
             tube = ReadData.Read("data.txt", ref tube);
             tube = ReadData.Read("data.txt", ref tube);
-            int i = 1;
-            foreach (Tubes tub in tube)
+
+            double[] diameters = new double[] { 20, 25, 32, 40, 50, 63 };
+
+            for (int i = 0; i < tube.Length; i++)
             {
             {
-                Console.WriteLine(i++ + " " + tub.name + " " + tub.isReinforced);
+                if (!(3960 <= tube[i].length && tube[i].length >= 4040))
+                {
+                    tube[i].isDefective = true;
+                }
             }
             }
+
+            
         }
         }
     }
     }
 }
 }

+ 1 - 0
Exam/ReadData.cs

@@ -34,6 +34,7 @@ namespace Exam
                 {
                 {
                     arr[i].isReinforced = true;
                     arr[i].isReinforced = true;
                 }
                 }
+                arr[i].isDefective = false;
                 i++;
                 i++;
             }
             }
             return arr;
             return arr;