elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


  Mostrar Temas
Páginas: [1]
1  Programación / Programación General / ayuda WindowsFormsApplication en: 5 Enero 2012, 02:49 am
necesito un ejercicio echo en WindowsFormsApplication pero que sea buenisimo  es urgente
2  Programación / .NET (C#, VB.NET, ASP) / S.O.S a todos los programadores de C sharp programa que gener un menu opcion en: 13 Noviembre 2011, 01:12 am
soy estudiante de ing. en sistemas tengo un ejercicio en c sharp para generar un menu en la primera opcion introdusco los datos y los muevo con un for pero en el 2 punto quiero leerlos ahi pero no tengo idea como hacerlo ayuda xfavor

Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace menu
  7. {
  8.    class Program
  9.    {
  10.        static void Main(string[] args)
  11.        {
  12.                        ConsoleKeyInfo op;
  13.  
  14.            do
  15.            {
  16.             //   Console.Clear(); //Limpiar la pantalla
  17.                Console.ForegroundColor = ConsoleColor.Green;
  18.                Console.WriteLine("\t\t\t\tMenú\n");
  19.                Console.ForegroundColor = ConsoleColor.Red;
  20.                Console.Write("[A]Ingresar datos\t");
  21.                Console.Write("[B] Mostar datos\t");
  22.                Console.Write("[C]Buscar\t");
  23.                Console.Write("[Esc]Salir\t\n\n");
  24.                Console.ForegroundColor = ConsoleColor.Blue ;
  25.                Console.WriteLine("Seleccione opcion...");
  26.                string datos;
  27.                op = Console.ReadKey(true);//Que no muestre la tecla señalada
  28.  
  29.                //métodos son acciones, las propiedades son valores
  30.                switch (op.Key)
  31.                {
  32.  
  33.  
  34.                    case ConsoleKey.A:
  35.                        Console.WriteLine("Ud seleccionó la opción Agregar datos ");
  36.  
  37.  
  38.                     for (int i = 0; i <= 3; i++)
  39.                     {
  40.                         Console.WriteLine("Ingrese datos:");
  41.                         datos = Console.ReadLine();
  42.  
  43.                     }
  44.  
  45.                        Console.Write("Presione una tecla para continuar...");
  46.                        Console.ReadKey();
  47.                     break;
  48.  
  49.                    case ConsoleKey.B:
  50.                        Console.WriteLine("Ud seleccionó la opción mostar  los datos");
  51.                        Console.Write("Presione una tecla para continuar...");
  52.                        Console.ReadKey();
  53.                        break;
  54.  
  55.                    case ConsoleKey.C:
  56.                        Console.WriteLine("Ud seleccionó la opción Buscar");
  57.                        Console.Write("Presione una tecla para continuar...");
  58.                        Console.ReadKey();
  59.                        break;
  60.  
  61.                    case ConsoleKey.Escape:
  62.                        Console.WriteLine("Chao");
  63.                        Console.ReadKey();
  64.  
  65.                        break;
  66.                }
  67.            } while (op.Key != ConsoleKey.Escape);
  68.        }
  69.    }
  70. }

        
    
3  Programación / .NET (C#, VB.NET, ASP) / Programa en C sharp que convierta binarios a decimal y decimal a binarios en: 13 Noviembre 2011, 00:18 am
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace decimal_binario
{
    class Program
    {
        static void Main(string[] args)
        {
            int numDecimal;
            List<int> bin = new List<int>();
            Console.WriteLine("Decimal a Binario:");
            Console.Write("Decimal: ");
            numDecimal = int.Parse(Console.ReadLine());

            Console.Write("Binario: ");
            do
                bin.Add(numDecimal % 2);
            while ((numDecimal /= 2) > 0);

            for (int i = bin.Count - 1; i >= 0; i--)
            Console.Write(bin);
            Console.Write("\n");
            Console.WriteLine("Binario a Decimal:");
            Console.Write("Binario: ");
            int nDecimal = int.Parse(Console.ReadLine());
            Console.Write("Decimal: ");
            Console.Write((Convert.ToInt64(nDecimal.ToString(), 2)).ToString());
            Console.ReadKey();

        }
    }
}
4  Programación / .NET (C#, VB.NET, ASP) / Programa en C sharp que genera un cuadrado magico , suma sus filas y columnas en: 13 Noviembre 2011, 00:15 am
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cuadrado_magico
{
    class Program
    {
        static void Main(string[] args)
        {
          

            int dimension = 5, n = 1;
            int[,] matriz = new int[dimension, dimension];
            int i = 0;
            int j = dimension / 2;
            int k = 0, l = 0;
            int[] Filas = new int[dimension];
            int[] Columnas = new int[dimension];

            matriz[i, j] = n++;

            for (k = i, l = j; n <= dimension * dimension; n++)
            {
                i--;
                j++;

                if (i < 0)
                    i = dimension - 1;
                if (j >= dimension)
                    j = 0;

                if (matriz[i, j] == 0)
                {
                    matriz[i, j] = n;
                }
                else
                {
                    k++;
                    if (k >= dimension)
                        k = 0;
                    matriz[k, l] = n;
                    i = k;
                    j = l;
                    continue;
                }
                k = i;
                l = j;
            }
            for (i = 0; i < dimension; i++)
            {
                for (j = 0; j < dimension; j++)
                {
                    Console.Write(" {0}", matriz[i, j].ToString("###"));
                }
                Console.WriteLine(Environment.NewLine);
            }
            for (i = 0; i < dimension; i++)
                for (j = 0; j < dimension; j++)
                {
                    Filas += matriz[i, j];
                    Columnas[j] += matriz[i, j];
                }
            for (i = 0; i < dimension; i++)
            {
                Console.WriteLine("Suma de la fila [{0}] es: {1}", i, Filas);
                Console.WriteLine("Suma de la columna [{0}] es: {1}", i, Columnas);
            }
            Console.ReadKey();
        }
    }
}
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines