我找不到任何可以解决此错误的方法:/ 我正在尝试将 2 个字母组合(例如 aa、ba、cb)作为乘数(aa*3=4*3 ba*2=3,5*2)。我的代码是;
string[] dersler = new string[9];
double[] kredi = new double[9];
double[] krediSonuclari = new double[9];
double derscarp(double s1, double s2)
{
return s1 * s2;
}
private void button1_Click(object sender, EventArgs e)
{
int i=0;
int j = 0;
foreach (TextBox item in Controls)
{
if (item.Name.Substring(0,7)=="txtders")
{
dersler[i] = Convert.ToString(item.Text);
i++;
}
}
foreach (TextBox item in Controls)
{
if (item.Name.Substring(0, 8) == "txtkredi")
{
kredi[j] = Convert.ToDouble(item.Text);
j++;
}
}
double toplam =0;
for (int k = 0; k < 9; k++)
{