Skip to content

Instantly share code, notes, and snippets.

@brayancruces
Created August 29, 2014 21:16
Show Gist options
  • Save brayancruces/d6371e836708185ad6ec to your computer and use it in GitHub Desktop.
Save brayancruces/d6371e836708185ad6ec to your computer and use it in GitHub Desktop.
EJERCICIO 08 - C++ UNIDAD
// EJERCICIO 08 - C++ UNIDAD
/*
Ingrese su código de alumno: 200810209
Ingresaste en el 2008-1
Tu código único es: 0209
*/
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int codigoupc,anio,ciclo,codunico;
cout<<"Ingrese codigo UPC: ";
cin>>codigoupc;
anio = codigoupc/100000;
ciclo = (codigoupc%100000)/10000;
codunico = codigoupc % 10000;
cout<<"Ingresaste en el "<<anio<<"-"<<ciclo<<endl;
cout<<"Tu codigo unico es:";
cout.width(4);
cout.fill('0');
cout<<codunico;
_getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment