Escolar Documentos
Profissional Documentos
Cultura Documentos
GRUPO: 254
ALGORITMO (5 VOCALES)
INICIO
INTRODUCE UN FRASE EN MINUSCULAS CALCULAR CUANTAS VECES APARECEN LAS VOCALES IMPRIMIR CUANTAS VECES APARECIERON LAS VOCALES FIN
DF:
INICIO
FIN
CODIGO: /* Programa que cuenta el numero de vocales expresadas en una frase */ #include<stdio.h> #include<conio.h> main()/* la funcin main inicia la ejecucin del programa */ { int CuentaCar1=0; int CuentaCar2=0; int CuentaCar3=0; int CuentaCar4=0; int CuentaCar5=0; char Cadena; printf("\t \t \t introduce una frase en minusculas\n\n"); printf("para obtener el resultado pesiona enter la tecla ctrl+Z, de nuevo enter:\n\n"); while (Cadena!=EOF) {
Cadena=getchar(); /* getchar lee los cracteres */ if (Cadena=='a') ++CuentaCar1; if (Cadena=='e') ++CuentaCar2; if (Cadena=='i') ++CuentaCar3; if (Cadena=='o') ++CuentaCar4; if (Cadena=='u') ++CuentaCar5;
} printf("\n aparecieron %d veces la letra 'a'",CuentaCar1); printf("\n aparecieron %d veces la letra 'e'",CuentaCar2); printf("\n aparecieron %d veces la letra 'i'",CuentaCar3); printf("\n aparecieron %d veces la letra 'o'",CuentaCar4); printf("\n aparecieron %d veces la letra 'u'",CuentaCar5); printf("\n\n presiona una tecla para salir"); getch(); return 0;/* indica terminacion exitosa del programa */
CONCLUSIONES:
ARMANDO DURAN SERRANO: EN ESTOS PROGRAMAS SE UTILIZARON LOS ARREGLOS, SE IMPLEMENTO LO APRENDIDO EN CLASE, ADEMAS HACIENDO MAS PROGRAMAS SE APRENDE MAS. JORGE PEREZ BUCIO
Codigo
#include <iostream> #include <stdlib.h> #include <conio.h> #include <stdio.h> using namespace std; /*Este programa lee los datos de una matriz 3x4 y muestra en pantalla la suma de los datos de cada fila */ cin >> matriz[i][j]; main(){ int matriz[5][5]; } } cout << "\n"; int arreglo[5]; int i,j; //Ingreso de los datos for (i=0;i<6;i++){ for (j=0;j<6;j++){ cout << "Ingrese el numero entero correspondiente a la posicion ["<<i<<"] ["<<j<<"]: "; for (i=0;i<5;i++){ for (j=0;j<5;j++){ cout << matriz[i][j]<<" "; } } 22; //Muestra en pantalla la matriz ingresada cout << "\nLa matriz que usted ingreso es: \n\n";
1 ,0},{0,0,0,0,1}}; int mon[5][5]={{0,0,1,0,0},{0,1,1,1,0},{1,1,1,1,1 },{0,1,1,1,0},{0,0,1,0,0}}; int a,b,c,d; printf("\n"); } for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { printf(" matriz 3 \n"); matriz[i][j]=contador++; } } getch(); for( int i=0;i<5;i++) { for(int j=0;j<5;j++) { printf(" matriz 2 \n"); for( int i=0;i<5;i++) { for(int j=0;j<5;j++) { printf("%d\t",m[j][i]); } printf("\n"); } } } } } m[i][j]=contadors++; } printf("\n"); printf("%d\t",mat[a][b]); } for(a=0;a<5;a++) { for(b=0;b<5;b++) {
Inicio escribir(Por favor digite el nmero) leer (totalDatos) i:=0 mientras (i<totalDatos) hacer escribir(Por favor digite el dato :) escribir(i+1) leer(coleccin[i]) i:= i+1 fin-mientras Imprime Matriz Fin