示例#1
0
        public static void Operaciones()
        {
            string linea, LE;
            int    suma;

            Console.WriteLine("**************************************************");
            Console.WriteLine("-----------Cantidad de Volcales Cerradas ---------");
            Console.WriteLine("**************************************************");

            Console.WriteLine("Digite una Frase : ");
            Console.WriteLine("");
            linea = Console.ReadLine();
            Console.WriteLine("***************************************************");
            suma  = 0;
            linea = linea.ToUpper();
            Console.WriteLine(linea);
            for (int i = 0; i < linea.Length; i++)
            {
                LE = Mid(linea, i, 1);
                if (LE.Contains("U") || LE.Contains("I"))
                {
                    suma = suma + 1;
                }
            }
            Console.WriteLine("****************************************************");
            Console.WriteLine("Existen {0} Vocales Cerradas. ", suma);
            Console.WriteLine("****************************************************");
            Console.WriteLine("Pulsa una tecla para volver al menu."); Console.ReadLine();
        }         //End Method
示例#2
0
        public static void CVocalesCerradas()
        {
            string NOM;
            int    K, SUM;
            string LE;

            Console.Write("DIGITE UNA FRASE : "); NOM = Console.ReadLine();
            SUM = 0;
            NOM = NOM.ToUpper();
            Console.Write(NOM);
            for (K = 1; K < NOM.Length; K++)
            {
                LE = Extras.Mid(NOM, K, 1);
                if (LE.Contains("U") || LE.Contains("I"))
                {
                    SUM = SUM + 1;
                }
            }
            Console.WriteLine("EXISTEN {0} VOCALES CERRADAS", SUM);
            Console.WriteLine("pulse una tecla:"); Console.ReadKey(); Console.Clear();
        }
        static void Main(string[] args)
        {
            string NOM;
            int    K, SUM;
            string LE;

            Console.Write("DIGITE UNA FRASE : "); NOM = Console.ReadLine();
            SUM = 0;
            NOM = NOM.ToUpper();
            Console.Write(NOM);
            for (K = 1; K < NOM.Length; K++)
            {
                LE = Mid(NOM, K, 1);
                if (LE.Contains("U") || LE.Contains("I"))
                {
                    SUM = SUM + 1;
                }
            }
            Console.WriteLine("EXISTEN {0} VOCALES CERRADAS", SUM);
            Console.Write("Pulse una Tecla:"); Console.ReadLine();
        }