#include <iostream>#include <limits.h>#include <stdlib.h>using namespace std;void tipoShort();void tipoInt();void tipoLong();void tipoLongLong();int creaMenu();int main(){ int salir = 0; while (!salir){ int valor = creaMenu(); if (valor < 1 || valor > 5){ cout << "\nValor incorrecto" << endl; continue; } switch (valor){ case 1: tipoShort(); break; case 2: tipoInt(); break; case 3: tipoLong(); break; case 4: tipoLongLong(); break; case 5: salir = 1; break; } } return 0;}void tipoShort(){ cout << "\t\tSIGNED SHORT" << endl; cout << sizeof(signed short) * CHAR_BIT << " bits" << endl; cout << sizeof(signed short) << " bytes" << endl; cout << "Valor Mínimo: " << SHRT_MIN << endl; cout << "Valor Máximo: " << SHRT_MAX << endl; cout << "\n\t\tUNSIGNED SHORT" << endl; cout << sizeof(unsigned short) * CHAR_BIT << " bits" << endl; cout << sizeof(unsigned short) << " bytes" << endl; cout << "Valor Máximo: " << USHRT_MAX << endl; system("pause");}void tipoInt(){ cout << "\t\tSIGNED INT" << endl; cout << sizeof(signed int) * CHAR_BIT << " bits" << endl; cout << sizeof(signed int) << " bytes" << endl; cout << "Valor Mínimo: " << INT_MIN << endl; cout << "Valor Máximo: " << INT_MAX << endl; cout << "\n\t\tUNSIGNED INT" << endl; cout << sizeof(unsigned int) * CHAR_BIT << " bits" << endl; cout << sizeof(unsigned int) << " bytes" << endl; cout << "Valor Máximo: " << UINT_MAX << endl; system("pause");}void tipoLong(){ cout << "\t\tSIGNED LONG" << endl; cout << sizeof(signed long) * CHAR_BIT << " bits" << endl; cout << sizeof(signed long) << " bytes" << endl; cout << "Valor Mínimo: " << LONG_MIN << endl; cout << "Valor Máximo: " << LONG_MAX << endl; cout << "\n\t\tUNSIGNED LONG" << endl; cout << sizeof(unsigned long) * CHAR_BIT << " bits" << endl; cout << sizeof(unsigned long) << " bytes" << endl; cout << "Valor Máximo: " << ULONG_MAX << endl; system("pause");}void tipoLongLong(){ cout << "\t\tSIGNED LONG LONG" << endl; cout << sizeof(signed long long) * CHAR_BIT << " bits" << endl; cout << sizeof(signed long long) << " bytes" << endl; cout << "Valor Mínimo: " << LLONG_MIN << endl; cout << "Valor Máximo: " << LLONG_MAX << endl; cout << "\n\t\tUNSIGNED LONG LONG" << endl; cout << sizeof(unsigned long long) * CHAR_BIT << " bits" << endl; cout << sizeof(unsigned long long) << " bytes" << endl; cout << "Valor Máximo: " << ULLONG_MAX << endl; system("pause");}int creaMenu(){ int valor; system("cls"); cout << "\t\tMENU" << endl; cout << "1. Tipo short" << endl; cout << "2. Tipo int" << endl; cout << "3. Tipo long" << endl; cout << "4. Tipo long long" << endl; cout << "5. Salir" << endl; cout << "\n>>> "; cin >> valor; if (!cin.good()) cin.clear(); cin.ignore(); return valor;}
abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k', 'l', 'm', 'n', 'ñ',\ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x','y', 'z', 'A', 'B', 'C',\ 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M','N', 'Ñ', 'O', 'P', 'Q',\ 'R', 'S', 'T', 'U', 'V','W', 'X', 'Y', 'Z']num = [34, 0, 2, 10, 51, 29, 18, 0, 2, 10]for n in num: print abc[n],
el programa trabaja con números muy grandes, cual de las variables tiene por asi decirlo "mayor capacidad" no se si me entendeis........
Veras ravenheart esque la forma en que lo he hecho transforma letras a numeros y con esos numeros se opera y solamente hay sumas y multiplicaciones, y ese proceso se repite varias veces dependiendo de la clave y el mensaje de modo que una letra puede corresponder al numero 2.687.997 o mayor.