[ create a new paste ] login | about

hmurcia

Name: Héctor Murcia Forero
Email:
Site/Blog:
Location: Bogotá
Default language: C++
Favorite languages: C/C++
About:

Saved pastes by hmurcia:

C++, pasted on Oct 19:
1
2
3
4
5
// PACMAN and GHOST WITH ASCII
#include <iostream>
using namespace std;

struct Person {
...
view (38 lines, 3 lines of output)
C++, pasted on Nov 6:
1
2
3
4
5
#include <iostream>
#include <cstdlib>
template <class T>
void cambio(T &a, T &b) {
    T t = a; a = b; b = t;
...
view (45 lines, 20 lines of output)
C++, pasted on Sep 26:
1
2
3
4
5
// PACMAN and GHOST WITH ASCII
#include <iostream>
using namespace std;

struct Person {
...
view (29 lines, 12 lines of output)
C++, pasted on Apr 30:
1
2
3
4
// using box, color, gotoxy and msgBox functions
#include <windows.h>
#include <ctime>
#include "mylib.h"
...
view (30 lines, 5 lines of output)
C++, pasted on Apr 6:
1
2
3
4
5
// Estructura Fraccion.  Operaciones simplifica, suma, resta y mostrar
// by hmurcia 2014

#include <iostream>
using namespace std;
...
view (62 lines, 2 lines of output)
C++, pasted on Mar 25:
1
2
3
4
// Manejo de archivos     -    ios_base::out|ios_base::in
#include <iostream>
#include <fstream>
using namespace std;
...
view (21 lines, 1 line of output)
C++, pasted on Mar 18:
1
2
3
4
5
#include <iostream>
#include "mylib.h"
using namespace std;

struct Triqui {
...
view (73 lines, 4 lines of output)
C++, pasted on Oct 28:
1
2
3
4
5
#include <iostream>
using namespace std;

class Animal {
    int fecNac;
...
view (18 lines, 3 lines of output)
C++, pasted on Oct 7:
1
2
3
4
// Files and structures sample
#include <iostream>
#include <fstream>
using namespace std;
...
view (39 lines, 6 lines of output)
C++, pasted on Sep 7:
1
2
3
4
5
// PALINDROME:  Determinar la suma de los dígitos de un numero dado y si es o no palindrome
#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
...
view (51 lines, 9 lines of output)
C++, pasted on Sep 7:
1
2
3
4
5
// PALINDROME:  Es un número dado, palíndrome o no?

#include<iostream>
#include<cstring>
using namespace std;
...
view (43 lines, 2 lines of output)
C++, pasted on Aug 1:
1
2
3
4
5
#include <iostream>
using namespace std;

int main() {
    short a=1, b=0, c=3, d=5;
...
view (16 lines, 5 lines of output)
C++, pasted on Jun 22:
1
2
3
4
5
#include <iostream>
#include <cstring>
using namespace std;

class Carro {
...
view (101 lines, 21 lines of output)
C++, pasted on Jun 19:
1
2
3
4
5
/*  USO DE WHILE Y DO WHILE

La principal diferencia entre la estructura WHILE y la DO WHILE está en el 
momento en que se EVALÚA la CONDICIÓN del CICLO DE REPETICIÓN.  Mientras
en el WHILE se evalua al inicio o comienzo del ciclo, en el DO WHILE se evalua
...
view (57 lines, 20 lines of output)
C++, pasted on May 26:
1
2
3
4
// Expresiones en C/C++

#include <iostream>
using namespace std;
...
view (36 lines, 27 lines of output)
C, pasted on May 25:
1
2
3
4
5
// mystery.c

#include <stdio.h>
main(t,_,a)
char *a;
...
view (18 lines, 66 lines of output)
C++, pasted on May 3:
1
2
3
4
5
#include <iostream>
using namespace std;

int main() {
    for (int c=32;  c<255; c++) {
...
view (9 lines, 23 lines of output)
C++, pasted on Apr 28:
1
2
3
4
5
/* Rotular o etiquetar los elementos del arreglo ventas de 3 filas por 5 columnas de doubles, para indicar el orden en que ellos toman el valor cero de acuerdo al siguiente segmento de programa:

    for ( fila = 0; fila <= 2; fila++ )
        for ( col = 0; col <= 4; col++ )
            ventas[fila][col] = 0;
...
view (26 lines, 3 lines of output)
C++, pasted on Apr 11:
1
2
3
4
5
// Raro este programa,  extraña la manera de manejar el fin de archivo (revisar)
#include <iostream>
#include <fstream>
using namespace std;
int archIguales( ifstream &, ifstream &);
...
view (38 lines, 1 line of output)
C++, pasted on Feb 14:
1
2
3
4
/* Se le pide al usuario el radio r de un círculo y el número de lados NL de un
   polígono regular inscrito en dicho círculo.

   Calcular y mostrar a través del uso de 3 o más funciones:
...
view (49 lines, 4 lines of output)
C++, pasted on Feb 6:
1
2
3
4
5
// Manejo de arreglos unidimensionales
#include <iostream>
using namespace std;

int main() {
...
view (17 lines, 4 lines of output)
C++, pasted on Feb 6:
1
2
3
4
5
#include <iostream>
using namespace std;

void ver(int [], int);
void ver(bool [], int);
...
view (27 lines, 6 lines of output)
C++, pasted on Jan 31:
1
2
3
4
5
#include <iostream>
using namespace std;

double potencia(double base, int pot);
double potencia(double base, double pot);
...
view (24 lines, 4 lines of output)
C++, pasted on Jan 13:
1
2
3
4
5
#include <iostream>
using namespace std;

int main() {
    cout << sizeof(bool) << endl
...
view (10 lines, 5 lines of output)
C++, pasted on Jan 13:
1
2
3
4
5
/* Escribir una función recursiva que determine si la suma de los n-1 primeros
   términos de valor par, de un vector o arreglo unidimensional de números,
   es igual al valor del n-ésimo término.

   Escribir la solución iterativa (no recursiva) de la función anterior.
...
view (30 lines)
C++, pasted on Dec 4:
1
2
3
4
5
// Manteniendo la alineación de columnas
// Listing 4-3 - Exploration 4 Strings (Pag. 28)
// Exploring C++ The Programmer's Introduction to C++ eBook

#include <iostream>
...
view (15 lines, 5 lines of output)
C++, pasted on Sep 7:
1
2
3
4
// Ejercicio : Permutaciones de una cadena de texto
//
#include <iostream>
using namespace std;
...
view (15 lines, 3 lines of output)
C++, pasted on Jul 31:
1
2
3
4
// Ejercicio #1: Hallar el error, corregir y explicar.
//
#include <iostream>
using namespace std;
...
view (15 lines, 3 lines of output)
C++, pasted on Jul 31:
1
2
3
4
5
/* Arreglo de arreglos (cadenas de texto). Manejo.
   En funciones como parámetros */
//
#include <iostream>
using namespace std;
...
view (47 lines, 4 lines of output)
C++, pasted on Jul 10:
1
2
3
4
#include <iostream>
using namespace std;

const double NUMERO_E = exp(1);
...
view (8 lines, 1 line of output)
C++, pasted on May 16:
1
2
3
4
5
/* La regla de la falsa posición:
   Mecanismo matemático antiguo, equivalente a la solución
   de ecuaciones de primer grado moderna

   http://www.matematicas.profes.net/archivo2.asp?id_contenido=40696
...
view (30 lines, 7 lines of output)
C++, pasted on May 4:
1
2
3
4
// Que switch mas raro!!
//
#include <iostream>
using namespace std;
...
view (21 lines, 1 line of output)
C++, pasted on May 4:
1
2
3
4
// Objetos - constructor de clase - Herencia del constructor
// conflictos 
#include <iostream>
using namespace std;
...
view (34 lines, 3 lines of output)
C++, pasted on May 4:
1
2
3
4
5
// Funciones - Maximo entre 4 valores, 3 valores y 2
// Aplicacion de: aleatorios, ciclo do while, continue
// 
#include <iostream>
using namespace std;
...
view (53 lines, 4 lines of output)
C++, pasted on Apr 7:
1
2
3
4
5
// Escritura y lectura de archivos de texto en C++
// http://ideone.com/dBFN8
#include <iostream>
#include <fstream>
using namespace std;
...
view (29 lines, 1 line of output)
C++, pasted on Mar 1:
1
2
3
4
// Paso por referencia???? Qué pasa???
//
#include <iostream>
using namespace std;
...
view (19 lines, 3 lines of output)
C++, pasted on Dec 13:
1
2
3
4
5
// Global and local variables
#include <iostream>
using namespace std;

double a = 128;
...
view (18 lines, 4 lines of output)
C++, pasted on Oct 27:
1
2
3
4
// Semana 1. Primer Programa C++

#include <iostream>
using namespace std;
...
view (8 lines, 1 line of output)
C++, pasted on Oct 14:
1
2
3
4
5
// CLASE MENU
//
#include <iostream>
#include <conio.h>
using namespace std;
...
view (43 lines, 4 lines of output)
C++, pasted on Sep 28:
1
2
3
4
// cilindro.cpp - (temas: estructuras y clases)

#include <iostream>
using namespace std;
...
view (85 lines, 4 lines of output)
C++, pasted on Aug 17:
1
2
3
4
5
// Numeros amigos (usando funciones)
#include <iostream>
using namespace std;

bool amigos( int, int );
...
view (36 lines, 6 lines of output)
C++, pasted on Aug 16:
1
2
3
4
5
// (R) Solución a cuadrática (sin structs, pasando parámetros por valor y referencia)

/* La ejecución del programa debe tener el siguiente aspecto:
   
   Ingresar coeficientes de la ecuación (a, b y c): 1  1  -6
...
view (83 lines, 3 lines of output)
C++, pasted on Aug 16:
1
2
3
4
5
// (R) Solución a cuadrática (sin structs, pasando parámetros por valor y referencia)

/* La ejecución del programa debe tener el siguiente aspecto:
   
   Ingresar coeficientes de la ecuación (a, b y c): 1  1  -6
...
view (83 lines, 3 lines of output)
C++, pasted on May 15:
1
2
3
4
5
// ALEATORIOS DE NUMEROS REALES COMPRENDIDOS ENTRE 2 LIMITES
//
#include <iostream>
#include <cstdlib>
using namespace std;
...
view (30 lines, 12 lines of output)
C++, pasted on Apr 13:
1
2
3
4
5
// BARAJA POKER
// TEMATICA: Estructuras, arreglos y funciones
//
// http://www.dynamicdrive.com/forums/archive/index.php/t-35174.html
// http://www.portalhacker.net/index.php/topic,115452.5/wap2.html
...
view (108 lines, 4 lines of output)
C++, pasted on Feb 24:
1
2
3
4
5
// Triangulo recursivo
// 

void repetir(char c, int n) {
    if (!n) {
...
view (27 lines, 1 line of output)
C++, pasted on Feb 14:
1
2
3
4
5
// Contador recursivo de numero de veces que aparece
// un caracter dado dentro de una cadena de texto
//
#include <iostream>
using namespace std;
...
view (47 lines, 7 lines of output)
C++, pasted on Feb 4:
1
2
3
4
5
// mylib.h   libreria para  gotoxy clreol clreoscr clrscr
#include <windows.h>
#include <iostream>
#include "mylib.h"
using namespace std;
...
view (99 lines, 5 lines of output)
C++, pasted on Feb 1:
1
2
3
4
5
// 20110201.3.cpp: Paso de arreglo unidimensional como parametro
#include <iostream>
using namespace std;

const short N = 10; // constante
...
view (32 lines, 5 lines of output)
C++, pasted on Sep 8:
1
2
3
4
5
// Programa es o no triangulo. Tipo de triangulo. If anidados. PROG1.
#include <iostream>
using namespace std;

int main() {
...
view (37 lines, 1 line of output)
C++, pasted on Sep 4:
1
2
3
4
5
// Separacion de elementos pares e impares con arreglos, apuntadores 
// y funciones

#include <iostream>
using namespace std;
...
view (67 lines, 29 lines of output)
C++, pasted on Aug 12:
1
2
3
4
5
// Calculator
// source: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4972&lngWId=3
#include <iostream>
using namespace std;
int main()
...
view (59 lines, 5 lines of output)
C++, pasted on Apr 29:
1
2
3
4
5
// CLASE MENU
//
#include <iostream>
#include <conio.h>
using namespace std;
...
view (43 lines, 11 lines of output)
C++, pasted on Apr 13:
1
2
3
4
5
// mylib.h    (libreria para MYGAME)
#ifndef VC2005
#include <windows.h>
#endif
#define borrapantalla()	system("cls");
...
view (13 lines, 1 line of output)
C++, pasted on Apr 13:
1
2
3
4
5
// MYGAME (LABERINTO)
//
#define VC2005
#ifndef VC2005
#include <windows.h>
...
view (210 lines, 5 lines of output)
C++, pasted on Apr 8:
1
2
3
4
// LECTURA s_quebrado CON FUNCION Y CON PROCEDIMIENTO
// ESTRUCTURAS, FUNCIONES Y PROCEDIMIENTOS, PASO POR REFERENCIA
#include <iostream>
using namespace std;
...
view (36 lines, 4 lines of output)
C++, pasted on Apr 5:
1
2
3
4
5
// TRAZA TABLERO AJEDREZ - ESTRUCTURAS Y FUNCIONES
#include <iostream>
using namespace std;

#define N    8
...
view (35 lines, 16 lines of output)