This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso OrdenarArregloInsercion | |
Dimension arre[12]; // 12 es el número total de elementos | |
Definir arre Como Entero; | |
Definir i, j, temp, pos Como Enteros; | |
Definir continuar Como Logico; | |
// Inicializar el arreglo | |
arre[0] <- 5; | |
arre[1] <- 3; | |
arre[2] <- 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso sin_titulo | |
Escribir elementoPos("dfg", 2); | |
FinProceso | |
SubProceso caracter <- elementoPos(cadena, pos) | |
Definir caracter Como Caracter; | |
Si pos >= 0 Y pos <= Longitud(cadena) Entonces | |
caracter <- Subcadena(cadena, pos, pos); | |
Sino | |
caracter <- ""; // Valor por defecto en error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cadena[100] texto | |
cadena[100] sub | |
funcion subcadena(cadena[100] S, entero X, entero _Y) : cadena[100] | |
cadena[100] r | |
entero i, j | |
inicio | |
r <- "" | |
si (X < 1) o (_Y > longitud(S)) o (X > _Y) entonces | |
retorne "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso sin_titulo | |
Escribir posicion("7", "12345678"); | |
FinProceso | |
SubProceso Retorno <- Posicion(subcad, cad) | |
Definir i, Retorno Como Enteros; | |
Retorno <- -1; | |
i <- 0; | |
Mientras i <= Longitud(cad) - Longitud(subcad) Hacer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso sin_titulo | |
Escribir Eliminar("Lenguaje PSeInt", 0, 9); // Eliminar "Lenguaje " | |
FinProceso | |
SubProceso Retorno <- Eliminar(Literal, Indice, Cantidad) | |
Definir Retorno Como Cadena; | |
Definir i Como Entero; | |
// Validación de parámetros | |
Si Indice < 0 | Indice >= Longitud(Literal) | Cantidad <= 0 Entonces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso ConvertidorNumerico | |
Definir entrada, numero, resultado Como Cadenas; | |
Definir DeBase, ABase Como Enteros; | |
Escribir "Ingrese el número a convertir: "; | |
Leer entrada; | |
Numero <- entrada; | |
Escribir "Ingrese la base del número (Binario = 2, Octal = 8, Decimal = 10, Hexadecimal = 16): "; | |
Leer DeBase; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <conio.h> | |
#include <ctype.h> | |
#include <math.h> | |
// Function prototypes | |
char* BinToHex(char* BinStr); | |
char* DecToBin(double DecNum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Proceso sin_titulo | |
Definir numval, numval2 Como Reales; | |
Definir sum Como Real; | |
Escribir '* Ingrese primer número'; | |
numval <- validarNumero(); | |
Escribir '* Ingrese segundo número'; | |
numval2 <- validarNumero(); | |
sum <- numval + numval2; | |
Escribir sum; | |
FinProceso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
real nNumero | |
cadena[100] cNumero // Definimos un tamaño máximo para la cadena | |
booleano lNumero | |
entero i | |
Funcion EsNumero(cadena[100] cNumero) : booleano | |
caracter cDigito | |
booleano lNumero | |
entero i | |
booleano puntoEncontrado |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Algoritmo proyecto_2 | |
Definir x,n,a,c,error Como Enteros; | |
Definir letra,vectorl,vector2 Como Caracteres; | |
Definir secreta Como Cadena; | |
Escribir "BIENVENIDOS AL JUEGO DEL AHORCADO"; | |
Escribir "Escriba la palabra secreta"; | |
Leer secreta; | |
n<-Longitud(secreta); | |
c<-0; | |
Dimension vectorl[n],vector2[n]; |
NewerOlder