Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- #include <locale.h>
- using namespace std;
- short uninum(long long fecha) {
- short UUU = (fecha / pow(10, 13));
- return UUU;
- }
- char fragil(long long fecha) {
- char F = (fecha % int(pow(10,13))) / pow(10, 12);
- return F;
- }
- char pais(long long fecha) {
- short PPPP=(fecha % int(pow(10, 12))) / pow(10, 8);
- return PPPP;
- }
- short dia(long long fecha) {
- short DD = (fecha % int(pow(10, 8))) / pow(10, 6);
- return DD;
- }
- short mes(long long fecha) {
- short MM = (fecha % int(pow(10, 6))) / pow(10, 4);
- return MM;
- }
- short año(long long fecha) {
- short AAAA = fecha % int(pow(10, 4));
- return AAAA;
- }
- int main()
- {
- setlocale(LC_CTYPE, "Spanish");
- long long fecha=0;
- char frg,frg2;
- cout << "Ingrese una fecha en el siguiente formato; UUUFPPPPDDMMAAA: "; cin >> fecha;
- frg = fragil(fecha);
- frg2 = (frg !=0)+'S';
- cout << "------------------------------------------------------------------------------------" << endl;
- cout << "Número único : " << uninum(fecha) << endl;
- cout << "Frágil(N : No; S: Sí) : " << frg2 << endl;
- cout << "País de procedencia : " << pais(fecha) << endl;
- cout << "Día, mes y año de vencimiento : ";
- cout << "Bien se encuentra vencido al día de hoy(N : No; S: Sí) : ";
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement