Advertisement
JottaJames

EX_3 C#_ASPNET_04_ARRAY

Apr 21st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Ex_3_ASPNET_04_Array
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             // Declarando variáveis
  14.             int[] iValoresX = new int[10];
  15.             int[] iValoresY = new int[10];
  16.  
  17.  
  18.             //Entrada de dados
  19.             for (int i = 0; i < iValoresX.Length; i++) //.Lenght trás o comprimento do array
  20.             {
  21.                 Console.Write("Digite o {0}º valor de X: ", (i + 1));
  22.                 iValoresX[i] = Convert.ToInt32(Console.ReadLine());
  23.             }
  24.  
  25.             Console.WriteLine("\n");
  26.             int iPosicaoY = 0;
  27.  
  28.             for (int j = 9; j >= 0; j--)
  29.             {
  30.                 iPosicaoY += 1;
  31.  
  32.                 iValoresY[j] = iValoresX[j];
  33.                 Console.WriteLine("{0}º valor de Y é: {1}",(iPosicaoY), iValoresY[j]);
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement