Ideias
Simulador da Mega - Sena
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#define qt_permitida 15
typedef struct{ char nome [15]; char sobrenome [15]; char estado [3]; char municipio [15]; int telefone; }dados;
int escolha();//QUANTIDADE DE NUMEROS A SER ESCOLHIDO PELO USUARIO int ch_de_estr();//CHAMADA DE ESTRUTURA DE INFORMACOES int wellcome();//BOAS VINDAS AO USUARIO int receber_aposta();//RECEBE OS NUMEROS PARA O SORTEIO int numeros_sorteados();//NUMEROS QUE SERAO SORTIADOS PELO SISTEMA int comparar_sor_apos();
//VARIAVEIS GLOBAL
dados info; int qt_de_numeros = 0 ; int recebe = 0 ; int nu_sorteio [qt_permitida]; int nu_apostador [7]; int guarda [7]; int global = 0; int pular = 0;
main() { int apagar; system("cls"); global = 0; system("title MEGA - SENA v.1.0 © Josue Moura"); char continuar; //INICIO DO PROGRAMA if(pular <= 0) { ch_de_estr();} escolha(); wellcome(); receber_aposta(); numeros_sortiados(); comparar_sor_apos(); printf("\n\n"); printf("Deseja tentar novamente s/n: "); scanf("%s",&continuar); if(continuar == 's') { for(apagar = 0;apagar <16;apagar++) { pular++; nu_apostador [apagar] = 0; } main(); } else { printf("\n\n\t\tEspero que tenha gostado do jogo (Mega - Sena).\n"); sleep(4000); } } int ch_de_estr()
{_flushall();
int cont; printf("\t------ Preencha as informacoes abaixo ------\n\n"); sleep(1500); printf("Nome: "); gets(&info.nome); printf("Sobrenome: ");