1 回答

TA贡献1797条经验 获得超6个赞
你应该定义 int[]activityTimes 作为一个全局变量,把它放在外面
public partial class Form1 : Form
{
string activity;
int activityTime;
bool enteredInt = false;
//initializes variables used to store activities
string activity1 = "";
string activity2 = "";
string activity3 = "";
string activity4 = "";
string activity5 = "";
//intitializes variables used to store activity times
int activityTime1 = 0;
int activityTime2 = 0;
int activityTime3 = 0;
int activityTime4 = 0;
int activityTime5 = 0;
int i;
string[] activities=new string[length];
public Form1()
{
InitializeComponent();
}
}
- 1 回答
- 0 关注
- 154 浏览
添加回答
举报