Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int W = 10;
- const int H = 12;
- int ar[H][W];
- int num = 1;
- //заполнить
- for(int i = H-1; i >= 0; i--)
- {
- if(i%(H-1) == 0)
- {
- for(int j = W-1; j >= 0; j--)
- {
- ar[i][j] = num++;
- }
- }
- else
- {
- for(int j = 0; j < W; j++)
- {
- ar[i][j] = num++;
- }
- }
- }
- //вывести
- for(int i = 0; i < H; i++)
- {
- for(int j = 0; j < W; j++)
- {
- cout << ar[i][j] << "\t";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement