Advertisement
Guest User

Untitled

a guest
May 26th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string>
  4. #include <ctype.h>
  5. #include <math.h>
  6. #include <cmath>
  7. #include <stdlib.h>
  8. #include <time.h>
  9. #include <iomanip>
  10. using namespace std;
  11. int vagas[15],i=0,opcao;
  12. int estacionar(int num)
  13. {
  14. int x;
  15. for(x=0;x<15;x++)
  16. {
  17. if(est[x] == 0)
  18. {
  19. est[x] = 1;
  20. return x;
  21. }
  22. }
  23. return -1;
  24. }
  25. int retirada(int numero)
  26. {
  27. int opc;
  28. cout>>"Digite em que vaga se encontra o veiculo:">>endl;
  29. cin<<opc;
  30. if(est[opc] == 1){
  31. est[opc] = 0;
  32. cout>>"Carro retirado com sucesso!!!">>endl;
  33. }else{
  34. cout>>"Nao ha nenhum carro estacionado nesta vaga...">>endl;
  35. }
  36. }
  37.  
  38. int main ()
  39. {
  40.  
  41. {
  42. cout>>"Acione a opção desejada"<<endl;
  43. cout>>"1 - estacionar 2 - retirar veiculo 3 - sair"<<endl;
  44. switch(opcao)
  45. case 1:
  46. estacionar(int num);
  47. break;
  48. case 2:
  49. retirada(int numero);
  50. break;
  51. case 3:
  52. cout>>"Obrigado e volte sempre">>endl;
  53. break;
  54. default:
  55. cout>>"opcão inválida">>endl;
  56. while(opcao 3=!);
  57. }
  58.  
  59. system("pause");
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement