martes, 10 de diciembre de 2019

Programa de nombres

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

using namespace std;
void menu();
void captura();
void imprimir();
void imprimirinvertido();
void salir();
int op;
char nom[50],ape1[50] ,ape2[50]   ;

int main()
{
    do{
        menu();
    }
    while(op!=4);
    return 0;
}
void menu()
{
cout << "." << endl;
cout << ".." << endl;
cout << "..." << endl;
cout << "....." << endl;
cout << "........" << endl;
cout << ".........." << endl;
cout << "............" << endl;
cout << "............" << endl;
cout << ".........." << endl;
cout << "........" << endl;
cout << "....." << endl;
cout << "..." << endl;
cout << ".." << endl;
cout << "." << endl;
cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°" << endl;
cout<<"########  ##      ########       "<<endl;
cout<<"##    ##  ##      ##           "<<endl;
cout<<"##    ##  ##      ##        "<<endl;
cout<<"########  ##      #####      "<<endl;
cout<<"##    ##  ##      ##     "<<endl;
cout<<"##    ##  ##      ##         "<<endl;
cout<<"##    ##  ######  ########        "<<endl;
    system("color 5f");
    cout<<"~~~~~"<<endl;
    cout<<"~~~~~"<<endl;
    cout<<"~~~~~"<<endl;
    cout<<"MY NAME IS ALE 7w7"<<endl;
    cout<<"312"<<endl;
    cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
    cout<<"***MENU***"<<endl;
    cout<<"1-Captura Tu nombre"<<endl;
    cout<<"2-Imprime Tu nombre"<<endl;
    cout<<"3-Imprime Inverso"<<endl;
    cout<<"5-Salir"<<endl<<endl;
    cout<<"~~~~~"<<endl;
    cout<<"~~~~~"<<endl;
    cout<<"~~~~~"<<endl;
    cin>>op;
    switch(op)
    {
    case 1: captura();
    break;
    case 2: imprimir();
    break;
    case 3: imprimirinvertido();
    break;
    case 4: salir();
    break;
    default:
        cout<<"Opcion erronea"<<endl;
    }
}
void captura()
{
cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
cout<<"Seleccionaste la opcion 1°"<<endl;
cout<<"Captura Tu nombre"<<endl;
cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;

    cout<<"Ingresa tu nombre:";
    cout<<"Captura un nombre:";
    gets(nom);
    cin>>nom;
    cout<<"Captura tu primer apelllido:";
    gets(ape1);
    cin>>ape1;
    cout<<"Captura un segundo apelllido:";
    gets(ape2);
    cin>>ape2;
}
void imprimir()
{
 cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
 cout<<"Seleccionaste la opcion 2°"<<endl;
 cout<<"Imptimem Tu nombre:"<<endl;
 cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
 cout<<"Tu nombre es:"<<endl;
    strcat(nom,ape1);
    strcat(nom,ape2);
    puts(nom);
}
void imprimirinvertido()
{
 cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
 cout<<"Seleccionaste la opcion 3°"<<endl;
 cout<<"Imptimem Tu nombre inverso"<<endl;
 cout<<"°°°°°°°°°°°°°°°°°°°°°°°°°°°°"<<endl;
 cout<<"Tu nombre inverso es:"<<endl;
    strcat(ape1,ape2);
    strcat(ape1,nom);
    puts(ape1);
}
void salir()
{

    cout<<"Fin del programa"<<endl;
}

No hay comentarios.:

Publicar un comentario