انجمن برنامه نویسان
.:: 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;

namespace list
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add(2);
listBox1.Items.Add(3);
listBox1.Items.Add(5);
listBox1.Items.Add(7);
for (int i = 8; i < 100; i++)
{

if (i%2!=0 && i%3!=0 && i%5!=0 && i%7!=0)
listBox1.Items.Add(i);
}
}

private void button2_Click(object sender, EventArgs e)
{
for (int i = 10; i < 100; i++)
if (i % 2 == 0 && i % 3 == 0)
listBox2.Items.Add(i);
}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}

private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
{

}
}


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

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

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

 

 

 

عکس شما

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





مشاهده ادامه مطلب لیست اعداد اول