Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- void Print (int mas[][10], int height, int width)
- {
- cout << "\t \tMassive" << endl;
- for (int y = 0; y < height; y++)
- {
- int summa = 0;
- for (int x = 0; x < width; x++)
- {
- mas[y][x] = rand() % 40;
- cout.width(4);
- cout << mas[y][x];
- summa += mas[y][x];
- }
- cout << " | " << summa << endl;
- }
- cout << "_________________________________________" << endl;
- for (int x = 0; x < width; x++)
- {
- int summa1 = 0;
- for (int y = 0; y < height; y++)
- {
- summa1 += mas[y][x];
- }
- cout.width(4);
- cout << summa1;
- }
- cout << endl;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- srand(time(NULL));
- const int height = 10;
- const int width = 10;
- int mas[height][width];
- Print(mas, 10, 10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement