انجمن برنامه نویسان
.:: Your Adversing Here ::.

تولید عدد تصادفی و مرتب سازی

  • سه شنبه 4 بهمن 1390برچسب:,
  • <-PostCategory->

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;


namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int sum;
private void Form1_Load(object sender, EventArgs e)
{

Random Number = new Random();
ArrayList rnd = new ArrayList();

for (int i = 0; i <= 10; i++)
{
rnd.Add(Number.Next(100));
listBox1.Items.Add(rnd[i]);


}
rnd.Sort();
for (int i = 0; i <= 10; i++)
{
listBox2.Items.Add(rnd[i]);


}

for (int i = 0; i <= 10; i++)
{
sum+=Convert.ToInt32( listBox2.Items[i]);

}
label1.Text = sum.ToString();
}
}


نظرات شما عزیزان:

نام :
آدرس ایمیل:
وب سایت/بلاگ :
متن پیام:
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

 

 

 

عکس شما

آپلود عکس دلخواه:





مشاهده ادامه مطلب تولید عدد تصادفی و مرتب سازی