Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro

Alpha Servers
Resultados 1 a 1 de 1

Hybrid View

  1. #1

    Avatar de Bullet
    Data de Ingresso
    Nov 2011
    Localização
    goiania
    Idade
    30
    Posts
    343
    Agradecido
    58
    Agradeceu
    45
    Peso da Avaliação
    16

    Padrão Menu de Opções [C++]

    Olá galerinha
    Estou Fazendo um Trabalho em minha Faculdade, porem estou encontrando dificuldades em fazer um Menu de Opções no meu Código de Criptografia gostaria de um Help ai da galera que sabe.
    Resolvi fazer dessa maneira porem esta apresentando erros


    Código:
    #include <cstdlib> 
    #include <iostream> 
    #include <stdio.h> 
    #include <stdlib.h> 
    #include <conio.h> 
    #include <string.h> 
    #include <fstream> 
    
    
    int opcao;
    // nessa parte aqui que não compila q eu to querendo colocar as opções... sak só..
    int main(){ 
    printf("Para Criptografar uma mensagem tecle 1, pare descriotografar tecle 2:\n"); 
    scanf("opcao"); 
    
           if (opcao=='1') 
    char get_str[3000]; 
    char cod_str[3000]; 
    
    char convnumlet(char numlet){ 
    
    // Tabela de Numero 
    if (numlet == '1') numlet = '&'; if (numlet == '2') numlet = '%'; if (numlet == '3') numlet = '#'; if (numlet == '4') numlet = '@'; if (numlet == '5') numlet = '$'; 
    if (numlet == '6') numlet = '!'; if (numlet == '7') numlet = '-'; if (numlet == '8') numlet = '*'; if (numlet == '9') numlet = '{'; if (numlet == '0') numlet = '+'; 
    
    // Tabela de Letras Maiscula
    if (numlet == 'A') numlet = '~'; if (numlet == 'B') numlet = '>'; if (numlet == 'C') numlet = ':'; if (numlet == 'D') numlet = '}'; if (numlet == 'E') numlet = '|'; 
    if (numlet == 'F') numlet = '€'; if (numlet == 'G') numlet = '†'; if (numlet == 'H') numlet = '‡'; if (numlet == 'I') numlet = '©'; if (numlet == 'J') numlet = '®'; 
    if (numlet == 'L') numlet = '¼'; if (numlet == 'M') numlet = '¶'; if (numlet == 'N') numlet = '¿'; if (numlet == 'O') numlet = 'ß'; if (numlet == 'P') numlet = 'Þ'; 
    if (numlet == 'Q') numlet = 'Ø'; if (numlet == 'R') numlet = 'Ð'; if (numlet == 'S') numlet = '÷'; if (numlet == 'T') numlet = '§'; if (numlet == 'U') numlet = '¬'; 
    if (numlet == 'V') numlet = '¢'; if (numlet == 'W') numlet = '£'; if (numlet == 'Y') numlet = '¥'; if (numlet == 'X') numlet = '¤'; if (numlet == 'Z') numlet = '•'; 
    if (numlet == 'K') numlet = '±';
    
    // Tabela de Letras Minisculas
    if (numlet == 'a') numlet = '~'; if (numlet == 'b') numlet = '>'; if (numlet == 'c') numlet = ':'; if (numlet == 'd') numlet = '}'; if (numlet == 'e') numlet = '|'; 
    if (numlet == 'f') numlet = '€'; if (numlet == 'g') numlet = '†'; if (numlet == 'h') numlet = '‡'; if (numlet == 'i') numlet = '©'; if (numlet == 'j') numlet = '®'; 
    if (numlet == 'l') numlet = '¼'; if (numlet == 'm') numlet = '¶'; if (numlet == 'n') numlet = '¿'; if (numlet == 'o') numlet = 'ß'; if (numlet == 'p') numlet = 'Þ'; 
    if (numlet == 'q') numlet = 'Ø'; if (numlet == 'r') numlet = 'Ð'; if (numlet == 's') numlet = '÷'; if (numlet == 't') numlet = '§'; if (numlet == 'u') numlet = '¬'; 
    if (numlet == 'v') numlet = '¢'; if (numlet == 'w') numlet = '£'; if (numlet == 'y') numlet = '¥'; if (numlet == 'x') numlet = '¤'; if (numlet == 'z') numlet = '•'; 
    if (numlet == 'k') numlet = '±'; if (numlet == ' ') numlet = '='; 
    return numlet; 
    } 
    
    char conversor(){ 
    for(int i=0;i<3000;i++){ 
    cod_str[i] = convnumlet (get_str[i]); 
    } 
    } 
    
    int main(){ 
    printf("Digite a Mensagem a ser Criptografada:\n"); 
    gets(get_str); 
    conversor(); 
    printf("\n\n"); 
    printf("A Mensagem foi Criptografada <ENTER>\n"); 
     printf("%s\n\n",cod_str); 
    getch(); 
    
    using namespace std; 
    { 
    ofstream ofs("C:\Mensagem-Criptografada.txt"); 
    if (ofs) { 
    ofs << ("%s\n\n",cod_str); } 
    return 0; } 
    } 
    
    
    
    
      else {
      
      char get_str[3000]; 
    char cod_str[3000]; 
    
    char convnumlet(char numlet){ 
    
    // Tabela para Lumeros 
    if (numlet == '&') numlet = '1'; if (numlet == '%') numlet = '2'; if (numlet == '#') numlet = '3'; if (numlet == '@') numlet = '4'; if (numlet == '$') numlet = '5'; 
    if (numlet == '!') numlet = '6'; if (numlet == '-') numlet = '7'; if (numlet == '*') numlet = '8'; if (numlet == '{') numlet = '9'; if (numlet == '+') numlet = '0'; 
    
    // Tabela para Letras 
    if (numlet == '~') numlet = 'a'; if (numlet == '>') numlet = 'b'; if (numlet == ':') numlet = 'c'; if (numlet == '}') numlet = 'd'; if (numlet == '|') numlet = 'e'; 
    if (numlet == '€') numlet = 'f'; if (numlet == '†') numlet = 'g'; if (numlet == '‡') numlet = 'h'; if (numlet == '©') numlet = 'i'; if (numlet == '®') numlet = 'j'; 
    if (numlet == '¼') numlet = 'l'; if (numlet == '¶') numlet = 'm'; if (numlet == '¿') numlet = 'n'; if (numlet == 'ß') numlet = 'o'; if (numlet == 'Þ') numlet = 'p'; 
    if (numlet == 'Ø') numlet = 'q'; if (numlet == 'Ð') numlet = 'r'; if (numlet == '÷') numlet = 's'; if (numlet == '§') numlet = 't'; if (numlet == '¬') numlet = 'u'; 
    if (numlet == '¢') numlet = 'v'; if (numlet == '£') numlet = 'w'; if (numlet == '¥') numlet = 'y'; if (numlet == '¤') numlet = 'x'; if (numlet == '•') numlet = 'z'; 
    if (numlet == '±') numlet = 'k'; if (numlet == '=') numlet = ' '; 
    
    return numlet; 
    } 
    
    char conversor(){ 
    for(int i=0;i<3000;i++){ 
    cod_str[i] = convnumlet (get_str[i]); 
    } 
    } 
    
    int main(){ 
    printf("A Mensagem abaixo sera Decriptografada <Enter>\n\n"); 
    FILE *pt; 
    pt=fopen("C:\Mensagem-Criptografada.txt","r");//abre o arquivo 
    fscanf(pt,"%s",get_str);//lê estring na tela 
    printf("%s", get_str);//escreve na tela 
    scanf("%[A-Z a-z]",get_str); 
    
    getch(); 
    conversor(); 
    printf("\n\n"); 
    printf("A Mensagem foi Decriptografada:\n\n\n"); 
    printf("%s \n\n\n", cod_str); 
    system("pause"); 
    
    
    return 0;
    }
    Última edição por Bullet; 07-11-2013 às 10:04 AM.
    Servidor Easy / Hard
    Nome: Mu Square
    Versão: 97D+1.0E Edition
    Experiência Free: 1.000x
    Experiência Vip Simples: 2.000x
    Experiência Super Vip: 5.000x
    Drop: 80%
    - PVP Equilibrado 100%
    Comandos Exclusivos para Player.
    Vários eventos e Novidades !
    Vagas na Staff

    Acesse: Hidden Content
    Fórum: Hidden Content
    Fan Page: Hidden Content

 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tópicos Similares

  1. |Dúvida| Exibir opções após passar mouse em cima
    Por HenriqueDias no fórum Dúvidas
    Respostas: 1
    Último Post: 04-12-2013, 11:56 AM
  2. |Dúvida| Editando menu
    Por C. Henrique no fórum Dúvidas
    Respostas: 1
    Último Post: 12-06-2012, 09:54 AM
  3. |Resolvido| Opções Level 380 no shoppingv3 e MuServer!
    Por Styllus no fórum Tópicos resolvidos
    Respostas: 8
    Último Post: 03-04-2012, 04:48 PM
  4. |Tutorial| Menu marcado - PHP
    Por 14biss no fórum Tutoriais
    Respostas: 0
    Último Post: 31-05-2011, 12:32 PM
  5. |Tutorial| Tradução das opçoes de Extra Features...
    Por Erick Paz no fórum Tutoriais
    Respostas: 0
    Último Post: 20-05-2011, 09:01 AM

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •