Guest User

Untitled

a guest
Feb 18th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace vetor5
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int cont;
  13.             int[] numA;
  14.             int[] numB;
  15.  
  16.             int numeros = 5;
  17.  
  18.             numA = new int[numeros];
  19.             numB = new int[numeros];
  20.  
  21.             for (cont = 0; cont < numeros; cont++)
  22.             {
  23.  
  24.                 Console.Write("\nVA Digite um valor para o " + (cont + 1) + " elemento: ");
  25.                 numA[cont] = int.Parse(Console.ReadLine());
  26.  
  27.             }
  28.             for (cont = 0; cont < numeros; cont++)
  29.             {
  30.                 Console.Write("\nVB Digite um valor para o " + (cont + 1) + " elemento: ");
  31.                 numB[cont] = int.Parse(Console.ReadLine());
  32.             }
  33.             Console.WriteLine("\n\nResultado: ");
  34.             Console.WriteLine("\n");
  35.             Array.Sort(numA);
  36.             foreach (int a in numA)
  37.             {
  38.                 Console.WriteLine(a);
  39.             }
  40.             Array.Sort(numB);
  41.             Console.WriteLine("\n");
  42.             foreach (int b in numB)
  43.             {
  44.                 Console.WriteLine(b);
  45.             }
  46.             Console.ReadKey();
  47.  
  48.         }
  49.     }
  50. }
Add Comment
Please, Sign In to add comment