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;
- using System.Threading.Tasks;
- namespace Ejercicio3
- {
- class Program
- {
- enum direcion { arriba = 1, abajo = 3, derecha = 2, izquieda = 4,
- abajoDerecha=23, abajoIzquierda=34,arribaDerecha=12,arribaIzquieda=14,
- prohibido };
- static void Main(string[] args)
- {
- string num = "";
- Console.WriteLine("Escribe la direcion que desees tomar");
- num = Console.ReadLine();
- string[] array = num.Split(',');
- for (int i = 0; i < array.Length; i++)
- {
- if (array[i].Length==2)
- {
- var a=int.Parse(array[i].Substring(0, 1));
- var b=int.Parse(array[i].Substring(1,2));
- {
- if (a < b)
- {
- array[i].Reverse;
- }
- }
- }
- Console.WriteLine("{0}", (direcion)int.Parse(array[i]));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment