我遇到了这个问题,我试图解决它,但我不能请我需要你的帮助..这是我的代码:
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
y=Convert::ToInt16(textBox1->Text);
c=Convert::ToInt16(textBox3->Text);
a=Convert::ToDouble(rand() % y);
b=Convert::ToDouble(rand() % c);
textBox2->Text = Convert::ToString(a);
textBox4->Text = Convert::ToString(b);
x1=0;
x2=0;
do
{
trafficlight(a,b,1,2);
}while(i==0);//here is my problem i need condition to make the while loop working while the program is running
如果我确实单击了按钮,它只会在没有前面的代码的情况下跳转到 while 循环,我需要前面的代码才能工作,并且条件使 while 循环在程序运行时工作..