TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chinh nguyen
NA
11
0
help me
Jan 27 2009 8:41 PM
i'm doing my work about "find X element in N random element"
i have the code.
private void chia1()
{
Random rand = new Random();
for (i = 0; i < cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox1.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia2()
{
Random rand = new Random();
for (i = cl.n / 100; i < 20 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox3.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia3()
{
Random rand = new Random();
for (i = 20 * cl.n / 100; i < 30 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox5.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia4()
{
Random rand = new Random();
for (i = 30 * cl.n / 100; i < 40 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox6.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia5()
{
Random rand = new Random();
for (i = 40 * cl.n / 100; i < 50 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox7.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia6()
{
Random rand = new Random();
for (i = 50 * cl.n / 100; i < 60 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox8.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia7()
{
Random rand = new Random();
for (i = 60 * cl.n / 100; i < 70 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox9.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia8()
{
Random rand = new Random();
for (i = 70 * cl.n / 100; i < 80 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox10.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia9()
{
Random rand = new Random();
for (i = 80 * cl.n / 100; i < 90 * cl.n / 100; i++)
{
m[i] = rand.Next(99);
textBox11.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
private void chia10()
{
Random rand = new Random();
for (i = 90 * cl.n / 100; i < cl.n; i++)
{
m[i] = rand.Next(99);
textBox12.Text += "" + m[i].ToString();
cl.m1[i] = m[i];
}
}
can you help me optimize it.
thanks.
Reply
Answers (
4
)
Want to Draw circle and divided that circle 108 Part
How to generate a PDF file in ASP.NET?