Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //int tab[5];
- //int ttt[5];
- //for(int i = 0; i < 5; i++)
- // tab[i] = i;
- //for(int i = 0; i < 5; i++)
- // ttt[i] = i*2;
- // for(int i = 0; i < 5; i++)
- // cout << tab[i];
- // cout << endl;
- //for(int i = 0; i < 5; i++)
- // cout << ttt[i];
- /***************************************/
- int tsa[2][5];
- int h = 1;
- for(int i = 0; i <3; i++)
- {
- for(int k = 0; k < 5; k++)
- {
- tsa[i][k] = h;
- h++;
- }
- }
- cout << tsa[0][0];
- cout << " ";
- cout << tsa[0][1];
- cout << " ";
- cout << tsa[0][2];
- cout << " ";
- cout << tsa[0][3];
- cout << " ";
- cout << tsa[0][4];
- cout << endl;
- cout << tsa[1][0];
- cout << " ";
- cout << tsa[1][1];
- cout << " ";
- cout << tsa[1][2];
- cout << " ";
- cout << tsa[1][3];
- cout << " ";
- cout << tsa[1][4];
- cout << endl;
- cout << tsa[2][0];
- cout << " ";
- cout << tsa[2][1];
- cout << " ";
- cout << tsa[2][2];
- cout << " ";
- cout << tsa[2][3];
- cout << " ";
- cout << tsa[2][4];
- cout << endl << endl;
- for(int i = 0; i < 3; i++)
- {
- for(int j = 0; j < 5; j++)
- {
- cout << tsa[i][j];
- cout << " ";
- if(j==4) cout << endl;
- }
- }
- cin.ignore();
- cin.get();
- }
Add Comment
Please, Sign In to add comment