Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace vetor5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int cont;
- int[] numA;
- int[] numB;
- int numeros = 5;
- numA = new int[numeros];
- numB = new int[numeros];
- for (cont = 0; cont < numeros; cont++)
- {
- Console.Write("\nVA Digite um valor para o " + (cont + 1) + " elemento: ");
- numA[cont] = int.Parse(Console.ReadLine());
- }
- for (cont = 0; cont < numeros; cont++)
- {
- Console.Write("\nVB Digite um valor para o " + (cont + 1) + " elemento: ");
- numB[cont] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("\n\nResultado: ");
- Console.WriteLine("\n");
- Array.Sort(numA);
- foreach (int a in numA)
- {
- Console.WriteLine(a);
- }
- Array.Sort(numB);
- Console.WriteLine("\n");
- foreach (int b in numB)
- {
- Console.WriteLine(b);
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment