VasilM

msgbox_blqlbq

Apr 5th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1.             int []chisla = new int[10];
  2.             Random rand = new Random();
  3.             for (int i = 0; i < chisla.Length; i++)
  4.             {
  5.                 chisla[i] = rand.Next(-10, 10);
  6.             }
  7.             label1.Text = "";
  8.                 foreach (int chislo in chisla)
  9.                 {
  10.                     label1.Text += chislo.ToString();
  11.                 }
  12.             Array.Sort( chisla );
  13.             label1.Text = "\n";
  14.             foreach (int chislo in chisla)
  15.             {
  16.                 label1.Text += chislo.ToString();
  17.             }
  18.              int k= 0, no=0;
  19.   DialogResult answer;
  20.      do   {          k++;
  21. answer=MessageBox.Show("iskash li da Prodaljish?", "Da/Ne?",        MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  22.               if (answer == DialogResult.Yes)  {    label1.Text = " kraj \n";   }
  23.                 else    
  24.               {         no++;   label1.Text = " otgowor no \n";   }
  25.             }
  26.       while (answer != DialogResult.Yes);
  27.   label1.Text  = label1.Text+"otgoworihte s 'no' "+ no +" pati" ;
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment