소스 검색

the first and second array created

unknown 1 년 전
부모
커밋
fa8df3d48d

BIN
ConsoleApp1/.vs/ConsoleApp1/FileContentIndex/30993d7a-1afb-4418-b319-0a5d5edf531e.vsidx


BIN
ConsoleApp1/.vs/ConsoleApp1/FileContentIndex/3113c00f-cac6-4a24-aa21-65800dc92d6a.vsidx


+ 33 - 1
ConsoleApp1/ConsoleApp1/Program.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace MyApp // Note: actual namespace depends on the project name.
+namespace ConsoleApp1// Note: actual namespace depends on the project name.
 {
     internal class Program
     {
@@ -30,8 +30,40 @@ namespace MyApp // Note: actual namespace depends on the project name.
                 }
                 Console.WriteLine();
             }
+            //Первый массив
+            Console.WriteLine(" ");
+            int v = n;
+            int[] M = new int[v];
+            for (int i = 0; i < v; i++)
+            {
+                Console.WriteLine("Введите " + '[' + i + ']' + " элемент: ");
+                M[i] = Convert.ToInt32(Console.ReadLine());
+                sum1 = sum1 + M[i];
+            }
+            Console.WriteLine("");
+            for (int i = 0; i < v; i++)
+            {
+                Console.Write("{0} ", M[i]);
+            }
 
+            //Второй массив
+            Console.WriteLine("\n");
+            int x = m;
+            int[] N = new int[x];
+            for (int i = 0; i < x; i++)
+            {
+                Console.WriteLine("Введите " + '[' + i + ']' + " элемент: ");
+                N[i] = Convert.ToInt32(Console.ReadLine());
+                 sum2 = sum2 + N[i];
+            }
+            Console.WriteLine(" ");
+            for (int i = 0; i < x; i++)
+            {
+                Console.Write("{0} ", N[i]);
+            }
+            Console.WriteLine("");
             
+
         }
     }
 }