Ошибка: "Error 1 Control cannot fall through from one case label" - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Stack<double> st = new Stack<double>();
double lol;
public Form1()
{
InitializeComponent();
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
double x;
if (e.KeyChar < '0' || e.KeyChar > '9')
{
st.Push(Convert.ToDouble(e.KeyChar));
}
else if (e.KeyChar < 'A' || e.KeyChar > 'Z')
{
st.Push(Convert.ToDouble(e.KeyChar));
}
else
switch (e.KeyChar)
{
case '/':
x = st.Pop();
st.Push(st.Pop() / x);
break;
case '+':
st.Push(st.Pop() / st.Pop());
break;
case '-':
x = st.Pop();
st.Push(st.Pop() - x);
break;
case '*':
//
break;
}
}
private void button1_Click(object sender, EventArgs e)
{
lol = st.Peek();
textBox2.Text = Convert.ToString(lol);
}
}
}Error 1 Control cannot fall through from one case label ('case '*' (0x2A):') to another C:\Users\user\Downloads\Proj\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 48 21 WindowsFormsApplication1
P.s сорри за быдлокод,всё ещё учусьРешение задачи: «Ошибка: "Error 1 Control cannot fall through from one case label"»
textual
Листинг программы
if (!Char.IsLetterOrDigit(e.KeyChar) st.Push(Convert.ToDouble(e.KeyChar));