Андрей Морозов 2 anos atrás
pai
commit
c788d9b5f0
2 arquivos alterados com 11 adições e 3 exclusões
  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;