Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int tab[100][100];
- void losuj(int wiersze, int kolumny)
- {
- for (int i = 0; i < wiersze; i++)
- {
- for (int j = 0; j < kolumny; j++)
- tab[i][j] = rand() % 20;
- }
- }
- void wypisz(int wiersze, int kolumny)
- {
- for (int i = 0; i < wiersze; i++)
- {
- for (int j = 0; j < kolumny; j++)
- {
- cout << setw(3) << tab[i][j];
- }
- cout << endl;
- }
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- int w, k;
- cout << "Ile wierszy i kolumn? ";
- cin >> w >> k;
- losuj(w, k);
- wypisz(w, k);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement