سفارش تبلیغ
صبا ویژن
در تجربه ها دانشی تازه است . [امام علی علیه السلام]

علمی ،آموزشی،تحقیقاتی

using System;

using System.Collections.Generic;

using System.Text;

using System.Collections;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Stack s = new Stack();

Console.WriteLine("Enter One Number:");

int a = Convert.ToInt16(Console.ReadLine());

while(a>0)

{

s.Push(a%2);

a = a / 2;

}

while (s.Count > 0)

Console.Write("{0}\t",s.Pop());

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:18 عصر

using System;

using System.Collections.Generic;

using System.Text;

using System.Collections;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

ArrayList a = new ArrayList();

for (int i = 0; i < 10; i++)

a.Add(i);

a.RemoveAt(5);

Console.WriteLine("{0}",a[5]);

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:17 عصر

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace WindowsApplication1

{

public partial class Form1 : Form

{

bool p = true;

byte mod;

double a, b, c;

public Form1()

{

InitializeComponent();

}

private void button1_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button1.Text;

else

{

textBox1.Clear();

textBox1.Text += button1.Text;

p = !p;

}

}

private void button16_Click( sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text );

p = !p;

mod = 1;

}

private void button2_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button2.Text;

else

{

textBox1.Clear();

textBox1.Text += button2.Text;

p = !p;

}

}

private void button12_Click( sender, EventArgs e)

{

b = Convert.ToDouble(textBox1.Text);

switch (mod)

{

case 1:

c = a + b;

break;

case 2:

c = a - b;

break;

case 3:

c = a * b;

break;

case 4:

c = a / b;

break;

}

textBox1.Text = c.ToString();

}

private void button13_Click( sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

p = !p;

mod = 2;

}

private void button15_Click( sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

p = !p;

mod = 3;

}

private void button14_Click( sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text);

p = !p;

mod = 4;

}

private void button3_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button3.Text;

else

{

textBox1.Clear();

textBox1.Text += button3.Text;

p = !p;

}

}

private void button4_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button4.Text;

else

{

textBox1.Clear();

textBox1.Text += button4.Text;

p = !p;

}

}

private void button5_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button5.Text;

else

{

textBox1.Clear();

textBox1.Text += button5.Text;

p = !p;

}

}

private void button6_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button6.Text;

else

{

textBox1.Clear();

textBox1.Text += button6.Text;

p = !p;

}

}

private void button7_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button7.Text;

else

{

textBox1.Clear();

textBox1.Text += button7.Text;

p = !p;

}

}

private void button8_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button8.Text;

else

{

textBox1.Clear();

textBox1.Text += button8.Text;

p = !p;

}

}

private void button9_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button9.Text;

else

{

textBox1.Clear();

textBox1.Text += button9.Text;

p = !p;

}

}

private void button10_Click( sender, EventArgs e)

{

if (p)

textBox1.Text += button10.Text;

else

{

textBox1.Clear();

textBox1.Text += button10.Text;

p = !p;

}

}

private void button17_Click( sender, EventArgs e)

{

a = Convert.ToDouble(textBox1.Text );

a = Math.Sin(a);

textBox1.Text = a.ToString();

}

private void Form1_Load( sender, EventArgs e)

{

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:16 عصر

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

int r;

Console.WriteLine("Enter Two Number");

int a=int.Parse(Console.ReadLine());

int b=Convert.ToInt16(Console.ReadLine());

while (a%b > 0)

{

r = a % b;

a = b;

b = r;

}

Console.WriteLine("{0}",b);

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:14 عصر

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

int[] a=new int[5];

for (int i = 0; i < 5; i++)

a[i] = Convert.ToInt16(Console.ReadLine());

for(int k=4;k>0;k--)

for(int j=0;j<k;j++)

if (a[j] > a[j + 1])

{

int temp = a[j];

a[j] = a[j + 1];

a[j + 1] = temp;

}

for (int i = 0; i < 5; i++)

Console.Write("{0}\t", a[i]);

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:13 عصر

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1

{

class Class1

{

public double r;

public Class1(int a)

{

r = a;

}

public double area()

{

return r * r * 3.14;

}

}

/********************************************************************************************/

class Program

{

static void Main(string[] args)

{

Class1 d = new Class1(1);

Console.WriteLine("{0}\n{1}",d.area(),Program.p(d));

Console.ReadLine();

}

static double p(Class1 c)

{

return (c.r) * 2 * 3.14;

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:12 عصر

using System;

using System.Collections.Generic;

using System.Text;

using System.Collections;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

ArrayList a = new ArrayList();

Random r = new Random();

int n;

do{

n = int.Parse(Console.ReadLine());

a.Add(n);

}while(n!=0);

while (a.Count != 1)

{

int x = r.Next() % a.Count;

Console.WriteLine("{0}", x);

a.RemoveAt(x);

}

Console.WriteLine("{0}",a[0]);

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:11 عصر

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{ int a, b,c;

Console.Write("Enter Three Number:");

a = Convert.ToInt16(Console.ReadLine());

b = Convert.ToInt16(Console.ReadLine());

c = Convert.ToInt16(Console.ReadLine());

int max = a;

if (b > max)

max = b;

else if (c > max)

max = c;

Console.WriteLine("Max={0}",max.ToString() );

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:11 عصر

using System;

using System.Collections.Generic;

using System.Text;

using System.Collections;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Queue q = new Queue();

int n;

do

{ n = int.Parse(Console.ReadLine());

q.Enqueue(n);

} while (n != 0);

int sum = 0;

while (q.Count != 2)

{

int a = Convert.ToInt16(q.Dequeue());

sum += Math.Abs(a-Convert.ToInt16(q.Peek()));

}

Console.WriteLine("{0}",sum );

Console.ReadLine();

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:9 عصر

using System;

using System.Collections.Generic;

using System.Text;

namespace WindowsApplication1

{

class Mathmatical

{

private double x;

public Mathmatical(double t)

{

x = t;

}

public double exp1()

{

return Math.Exp(x);

}

public double logx()

{

return Math.Log10(x);

}

~Mathmatical()

{

x = 0;

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 1:7 عصر

<      1   2   3      >
>> بازدیدهای وبلاگ <<
بازدید امروز: 9


بازدید دیروز: 8


کل بازدید :59480
 
 >>اوقات شرعی <<
 
>> درباره خودم<<
مدیر وبلاگ : مژده فرجی[85]
نویسندگان وبلاگ :
سمانه طالبی (@)[0]

مژده فرجی (@)[0]


 
 
>>موسیقی وبلاگ<<
 
>>اشتراک در خبرنامه<<
 
 
>>طراح قالب<<