我正在用 C# 构建一个测验,它可以工作并将结果显示为字符串,但是我希望结果显示为 % - 我该怎么做?
protected void Button1_Click(object sender, EventArgs e)
{
int score = 0;
if (qn1.SelectedValue == "Yes")
score++;
if (qn2.SelectedValue == "Yes")
score++;
if (qn3.SelectedValue == "Yes")
score++;
if (qn4.SelectedValue == "Yes")
score++;
if (qn5.SelectedValue == "Yes")
score++;
literalScore.Text = score.ToString();
}