示例#1
0
文件: Form1.cs 项目: Ethan-Hyde/Lab-4
 private void forLoopToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Lab4TxT.Clear();
     for (int num = 1; num <= 7; num++)
     {
         Lab4TxT.Text += num + "\r\n";
     }
 }
示例#2
0
文件: Form1.cs 项目: Ethan-Hyde/Lab-4
 private void forEachLoopToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Lab4TxT.Clear();
     int[] feLoop = new int[] { 1, 2, 3, 4, 5, 6, 7 };
     foreach (int element in feLoop)
     {
         Lab4TxT.Text += element;
         Lab4TxT.Text += "\r\n";
     }
 }
示例#3
0
文件: Form1.cs 项目: Ethan-Hyde/Lab-4
        private void whileLoopToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Lab4TxT.Clear();
            int wLoop = 0;

            while (wLoop <= 6)
            {
                wLoop++;
                Lab4TxT.Text += wLoop + "\r\n";
            }
        }
示例#4
0
文件: Form1.cs 项目: Ethan-Hyde/Lab-4
        private void doWhileLoopToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Lab4TxT.Clear();
            int dwLoop = 0;

            do
            {
                dwLoop++;
                Lab4TxT.Text += dwLoop + "\r\n";
            }while (dwLoop <= 6);
        }
示例#5
0
文件: Form1.cs 项目: Ethan-Hyde/Lab-4
 private void nestedForLoopToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Lab4TxT.Clear();
     for (int nest = 1; nest <= 7; nest++)
     {
         for (int nest2 = 1; nest2 <= nest; nest2++)
         {
             Lab4TxT.Text += nest2;
         }
         Lab4TxT.Text += "\r\n";
     }
 }