Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string>
- #include <ctype.h>
- #include <math.h>
- #include <cmath>
- #include <stdlib.h>
- #include <time.h>
- #include <iomanip>
- using namespace std;
- int vagas[15],i=0,opcao;
- int estacionar(int num)
- {
- int x;
- for(x=0;x<15;x++)
- {
- if(est[x] == 0)
- {
- est[x] = 1;
- return x;
- }
- }
- return -1;
- }
- int retirada(int numero)
- {
- int opc;
- cout>>"Digite em que vaga se encontra o veiculo:">>endl;
- cin<<opc;
- if(est[opc] == 1){
- est[opc] = 0;
- cout>>"Carro retirado com sucesso!!!">>endl;
- }else{
- cout>>"Nao ha nenhum carro estacionado nesta vaga...">>endl;
- }
- }
- int main ()
- {
- {
- cout>>"Acione a opção desejada"<<endl;
- cout>>"1 - estacionar 2 - retirar veiculo 3 - sair"<<endl;
- switch(opcao)
- case 1:
- estacionar(int num);
- break;
- case 2:
- retirada(int numero);
- break;
- case 3:
- cout>>"Obrigado e volte sempre">>endl;
- break;
- default:
- cout>>"opcão inválida">>endl;
- while(opcao 3=!);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement