#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#define SIZE 5
//função de ordenação
void Ordena(int vet[SIZE]){
 int aux;
 
 for(int i = 0; i < SIZE; i++){
  for (int j = 0; j < SIZE-1; j++){
   if(vet[j] > vet[j+1]){
    aux = vet[j];
    vet[j] = vet[j+1];
    vet[j+1] = aux;
   }
  }
 }
 
 for(int i = 0; i < SIZE; i++){
  printf("\t%d", vet[i]);
 }
 
}
int main() {
 int vetor[SIZE]= {13, 21, 7, 5, 45};
 
 //int vetor[SIZE];
 int aleatorio[SIZE], x[SIZE];
 int cont;
 /*
 printf("\nDigite 5 numeros de 0 a 60: \n");
 for(int i = 0; i < SIZE; i++){
  printf("%d: ",i+1);
  scanf("%d", &vetor[i]);
 }*/
 
 printf("\n\tNUMEROS JOGADOS: \n\n");
 Ordena(vetor);
 printf("\n\n\tNUMEROS SORTEADOS: \n\n ");
 
 //sorteando os numeros aleatorios
 srand(time(NULL));// não gerar os mesmos numeros aleatorios repetidos a cada compilação
 for(int i = 0; i < SIZE; i++){
  aleatorio[i] = 0 + (rand()%60);
 }
 
 Ordena(aleatorio);
 
 printf("\n\n");
 for(int i = 0; i < SIZE; i++){
  x[i] = aleatorio[i];
  if(x[i] == vetor[i]){
   cont++;
   printf("Voce acertou o %d numero: [%d]\n", i+1, x[i]);
  }
 }
 
 printf("\n\n");
 return 0;
}