Guest User

Untitled

a guest
Dec 15th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.     //int tab[5];
  8.     //int ttt[5];
  9.  
  10.     //for(int i = 0; i < 5; i++)
  11.     //  tab[i] = i;
  12.     //for(int i = 0; i < 5; i++)
  13.     //  ttt[i] = i*2;
  14.     //  for(int i = 0; i < 5; i++)
  15.     //  cout << tab[i];
  16.     //  cout << endl;
  17.     //for(int i = 0; i < 5; i++)
  18.     //  cout << ttt[i];
  19.  
  20.     /***************************************/
  21.  
  22.     int tsa[2][5];
  23.     int h = 1;
  24.  
  25.     for(int i = 0; i <3; i++)
  26.     {
  27.        
  28.         for(int k = 0; k < 5; k++)
  29.         {
  30.             tsa[i][k] = h;
  31.             h++;
  32.            
  33.         }
  34.     }
  35. cout << tsa[0][0];
  36. cout << " ";
  37. cout << tsa[0][1];
  38. cout << " ";
  39. cout << tsa[0][2];
  40. cout << " ";
  41. cout << tsa[0][3];
  42. cout << " ";
  43. cout << tsa[0][4];
  44.  
  45. cout << endl;
  46. cout << tsa[1][0];
  47. cout << " ";
  48. cout << tsa[1][1];
  49. cout << " ";
  50. cout << tsa[1][2];
  51. cout << " ";
  52. cout << tsa[1][3];
  53. cout << " ";
  54. cout << tsa[1][4];
  55.  
  56. cout << endl;
  57. cout << tsa[2][0];
  58. cout << " ";
  59. cout << tsa[2][1];
  60. cout << " ";
  61. cout << tsa[2][2];
  62. cout << " ";
  63. cout << tsa[2][3];
  64. cout << " ";
  65. cout << tsa[2][4];
  66.  
  67. cout << endl << endl;
  68.  
  69. for(int i = 0; i < 3; i++)
  70. {
  71.     for(int j = 0; j < 5; j++)
  72.     {
  73.         cout << tsa[i][j];
  74.         cout << " ";
  75.         if(j==4) cout << endl;
  76.        
  77.  
  78.     }
  79. }
  80.  
  81.     cin.ignore();
  82.     cin.get();
  83.  
  84. }
Add Comment
Please, Sign In to add comment