namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Not.Text =
(Convert.ToInt32(quiz1per.Text)) * (Convert.ToInt32(quiz1poi.Text)) +
(Convert.ToInt32(quiz2per.Text)) * (Convert.ToInt32(quiz2poi.Text)) +
(Convert.ToInt32(odev1per.Text)) * (Convert.ToInt32(odev1poi.Text)) +
(Convert.ToInt32(odev2per.Text)) * (Convert.ToInt32(odev2poi.Text)) +
(Convert.ToInt32(vizeper.Text)) * (Convert.ToInt32(vizepoi.Text)) +
(Convert.ToInt32(finalper.Text)) * (Convert.ToInt32(finalpoi.Text));
}
}
}
一旦我到了最後的分號,我有一個問題轉換INT爲字符串。 我剛剛開始C#,我想先學習基本的東西。問題轉換「詮釋」到「線」,也與數學運算符
您不能在C#中將'int'強制轉換爲'string'。你的第二個例子甚至不會編譯。 – shf301