Mostrando entradas con la etiqueta Estructuras de datos. Arreglos (vectores y matrices). Mostrar todas las entradas
Mostrando entradas con la etiqueta Estructuras de datos. Arreglos (vectores y matrices). Mostrar todas las entradas

Suma Matriz Bidimensional 3x2





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

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

//Variables
int s = 0, i, j;

// Arreglos

int[,] n = new int[3, 2];

//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
n[0, 0] = int.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
n[0, 1] = int.Parse(textBox2.Text);
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
n[1, 0] = int.Parse(textBox3.Text);
}

private void textBox4_TextChanged(object sender, EventArgs e)
{
n[1, 1] = int.Parse(textBox4.Text);
}

private void textBox5_TextChanged(object sender, EventArgs e)
{
n[2, 0] = int.Parse(textBox5.Text);
}

private void textBox6_TextChanged(object sender, EventArgs e)
{
n[2, 1] = int.Parse(textBox6.Text);
}


Ordenación por Intercambio (Burbuja)





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

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

//Variables
int tmp, i, j, LI, LS;

//Arreglos
int[] n = new int[4];

private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}

//Entrada
private void textBox1_TextChanged(object sender, EventArgs e)
{
n[0] = int.Parse(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
n[1] = int.Parse(textBox2.Text);
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
n[2] = int.Parse(textBox3.Text);
}

private void textBox4_TextChanged(object sender, EventArgs e)
{
n[3] = int.Parse(textBox4.Text);
}


Suma de los elementos de un Vector





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

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

               //Variables
                int s = 0, i;

              //Arreglos
              int[] n = new int[5];

            //Entrada
           private void textBox1_TextChanged(object sender, EventArgs e)
          {
           n[0] = int.Parse(textBox1.Text);
          }
           private void textBox2_TextChanged(object sender, EventArgs e)
          {
           n[1] = int.Parse(textBox2.Text);
          }
           private void textBox3_TextChanged(object sender, EventArgs e)
         {
           n[2] = int.Parse(textBox3.Text);
          }
           private void textBox4_TextChanged(object sender, EventArgs e)
         {
           n[3] = int.Parse(textBox4.Text);
       }
           private void textBox5_TextChanged(object sender, EventArgs e)
         {
           n[4] = int.Parse(textBox5.Text);
          }

Convertir fecha






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

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

//Variables
int dia, mes, año;
string [] Meses = {
"Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"
 };
private void textBox1_TextChanged(object sender, EventArgs e)
{
dia = Convert.ToInt32(textBox1.Text);
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
mes = Convert.ToInt32(textBox2.Text);
}