Андрей Морозов %!s(int64=2) %!d(string=hai) anos
pai
achega
c788d9b5f0
Modificáronse 2 ficheiros con 11 adicións e 3 borrados
  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];
             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].isDefective = false;
                 i++;
             }
             return arr;