主题:[求助]请问大家!下列的代码那里有错,谢谢!
请问大家!下列的代码那里有错,谢谢!
[size=2]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int k = int.Parse(textBox1.Text);
switch(k/10)
{[color=FF0000]_[/color]
case0:
case1:
case2:
case3:
case4:
case5:
textBox2.Text="不及格";
break;
case6:
textBox2.Text="及格";
break;
case7:
textBox2.Text="中等";
break;
case8:
textBox2.Text="良好";
break;
case9:
case10:
textBox2.Text="优秀";
break;
default;[color=FF0000]_[/color]
MessageBox.Show("成绩输入错误,请重新输入!");
break;[color=FF0000]_[/color]
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}[/size]
上边有红色的_都是系统提出有错误的地方,老说要加上"}""{"我找了很久也找不到结果,请大家们帮手看看!
[size=2]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int k = int.Parse(textBox1.Text);
switch(k/10)
{[color=FF0000]_[/color]
case0:
case1:
case2:
case3:
case4:
case5:
textBox2.Text="不及格";
break;
case6:
textBox2.Text="及格";
break;
case7:
textBox2.Text="中等";
break;
case8:
textBox2.Text="良好";
break;
case9:
case10:
textBox2.Text="优秀";
break;
default;[color=FF0000]_[/color]
MessageBox.Show("成绩输入错误,请重新输入!");
break;[color=FF0000]_[/color]
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}[/size]
上边有红色的_都是系统提出有错误的地方,老说要加上"}""{"我找了很久也找不到结果,请大家们帮手看看!