jueves, 21 de abril de 2016

uri 1005 solution c#

using System;

class URI {

    static void Main(string[] args) {

            double a, b;
            a = Convert.ToDouble(Console.ReadLine());
            b=Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("MEDIA = " + ((a*3.5 + b*7.5)/(3.5+7.5)).ToString("0.00000"));
            Console.ReadKey();

    }

}

uri 1004 solution c#

using System;

class URI {

    static void Main(string[] args) {

            int a, b;
            a = Convert.ToInt32(Console.ReadLine());
            b=Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("PROD = " + (a * b));
            Console.ReadKey();

    }

}

uri 1003 solution c#

using System;

class URI {

    static void Main(string[] args) {
             int a, b;
            a = Convert.ToInt32(Console.ReadLine());
            b=Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("SOMA = " + (a + b));
            Console.ReadKey();
    }

}

uri 1001 solution c#

using System;

class URI {

    static void Main(string[] args) {

            int a, b;
            a = Convert.ToInt32(Console.ReadLine());
            b=Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("X = "+(a+b));
            Console.ReadKey();

    }

}

uri 1002 solution C#

using System;

class URI {

    static void Main(string[] args) {

           double RADIO, AREA;
            RADIO = Convert.ToDouble(Console.ReadLine());
            AREA = 3.14159 * (RADIO * RADIO);
            Console.WriteLine("A="+AREA.ToString("0.0000"));
            Console.ReadKey();
    }

}

jueves, 19 de marzo de 2015

Convertir una variable String a Bool c#



 para convertir una variable String  Bool:
  


string aconvertir;
convert.toBoolean(aconvertir);


y listo.

Abrir un form y luego regresar al anterior C#



                   Hola esto es fácil solo pondremos en el botón para abrir la otra forma el siguiente código:


 objetoForm f2=new objetoForm();
this.Hide();
f2.ShowDialog();
this.Show;

Ejemplo:
  public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
              otraForma f = new otraForma();
               this.Hide();
               f.ShowDialog();
               this.Show();

        }