string[] strängVektor = new string[5]; bool minBool = true; int input = 0; string föremål; while (minBool) { Console.WriteLine("Välkommen till ryggsäcken!"); Console.WriteLine("[1] Lägg till fem föremål i ryggsäcken"); Console.WriteLine("[2] Skriv ut dina fem föremål"); Console.WriteLine("[3] Sök i ryggsäcken"); Console.WriteLine("[4] Avsluta programmet"); input = Convert.ToInt32(Console.ReadLine()); switch (input) { case 1: for (int i = 0; i < 6; i++) { Console.WriteLine(strängVektor[i]); } break; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter