我想增加我的循环。首先我初始化i = 0和k = 0然后我想用这个增量值初始化我。我已经尝试过这些代码但它不起作用。请帮帮我从这些问题
for (i = 0; i < totalcount; i++)
{
for (k = 0; k < totalstudent; k++)
{
dt.Rows.Add(companyname[i], companyemail[i], studentname[k]);
}
}
i = totalcount;
k = totalstudent;
totalcount += totalcount;
totalstudent++;
但是,如果我以另一种方式写它的增量。我已经附加了我的下面的代码。但这不是正确的方法。我不能一次又一次地写循环
for (i = 0; i < totalcount; i++)
{
for (k = 0; k < totalstudent; k++)
{
dt.Rows.Add(companyname[i], companyemail[i], studentname[k]);
}
}
for (i = totalcount; i < totalcount+totalcount; i++)
{
for (k = totalstudent; k < totalstudent+totalstudent; k++)
{
dt.Rows.Add(companyname[i], companyemail[i], studentname[k]);
}
}