Advertisement
vitorialucena

agora

Nov 15th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int mapa(int i, int j) {
  5. string a[17][8];
  6. for(i=0; i<17; i++) {
  7. for(j=0; j<8; j++) {
  8. a[i][j]={"L"};
  9. }
  10. }
  11.  
  12. cout << "terreo\n";
  13. for(i=0; i<3; i++) {
  14. for(j=0; j<8; j++) {
  15.  
  16. if(i<=1) {
  17. if(j<5)
  18. cout << a[i][j] << " | ";
  19. }
  20. else {
  21. cout << a[i][j] << " | ";}
  22.  
  23. }
  24.  
  25. if(j=5)
  26. cout << "\n\n";
  27.  
  28. }
  29.  
  30. cout << "\nprimeiro andar: esquerda\n";
  31. for(i=3; i<9; i++) {
  32. for(j=0; j<6; j++) {
  33. cout << a[i][j] << " | ";
  34.  
  35. if(j%2!=0)
  36. cout << "\t";
  37. }
  38.  
  39. if(j==6) {
  40. cout << "\n";
  41. }
  42. }
  43.  
  44. cout<< "\nprimeiro andar: direita\n";
  45. for(i=9; i<17; i++) {
  46. for(j=0; j<6; j++) {
  47. cout << a[i][j] << " ";
  48. if(j%2!=0) {
  49. cout << "| ";}
  50. }
  51.  
  52. if(j==6) {
  53. cout << "\n";
  54. }
  55.  
  56. if(i%2!=0) {
  57. cout << "\n";
  58. }
  59. }
  60. }
  61.  
  62. int main() {
  63. int i, j, n;
  64. string a[17][8];
  65. for(i=0; i<17; i++) {
  66. for(j=0; j<8; j++) {
  67. a[i][j]={"L"};
  68. }
  69. }
  70.  
  71. mapa(17, 8);
  72. cout << "\nBem-vindo ao mapa de reservas da biblioteca POLI-UPE. Para começar, escolha o lugar em que você quer estudar.";
  73. cout << "\n\nqual lugar voce quer reservar?\n";
  74. cout << "linha: ";
  75. cin >> i;
  76. while(i<0 or i>16) {
  77. cout << "linha inexistente. observe o mapa e escolha outra.\nlinha: ";
  78. cin >> i;
  79. }
  80.  
  81. cout << "coluna: ";
  82. cin >> j;
  83. //colocar alguma coisa que limite esse j>5 or j<8 pra quando i<=1
  84. while(j<0 or j>7) {
  85. cout << "coluna inexistente. observe o mapa e escolha outra.\ncoluna: ";
  86. cin >> j;
  87. }
  88. cout << "o local escolhido foi: " << a[i][j] << "\n\n";
  89.  
  90. a[i][j]={"X"};
  91. mapa[17][8];
  92.  
  93. cout << "deseja mais algum lugar?\n1 - sim \t 2 - nao\n";
  94. cin >> n;
  95. while(n<1 or n>2) {
  96. cout << "escolha uma das opcoes.\n";
  97. cin >> n;
  98. }
  99. if(n==2) {
  100. cout << "lugar(es) " << a[i][j] << ", " << " reservado com sucesso\n\n";
  101. a[i][j]={"X"};
  102. mapa[17][6];
  103. }
  104. else {
  105.  
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement