Switch case esempio:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleProject
{
class Program
{
public static void Main()
{
Console.WriteLine("yyyyyy size: 1=Piccolo 2=Medio 3=Grande");
Console.Write("Inserisci il valore: ");
string s = Console.ReadLine();
int n = int.Parse(s);
int cost = 0;
switch (n)
{
case 1:
cost += 25;
break;
case 2:
cost += 25;
goto case 1;
case 3:
cost += 50;
goto case 1;
default:
Console.WriteLine("Selezione invalida. Inserire 1, 2, or 3.");
break;
}
if (cost != 0)
Console.WriteLine("Inserisci {0} size.", cost);
Console.WriteLine("Ciao.");
}
}
}