Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <ctime>
- using namespace std;
- void drukujTablice(int tablica[5][5], int x, int y) {
- for (int i = 0; i < x; i++) {
- for (int j = 0; j < y; j++) {
- cout << tablica[i][j] << " ";
- }
- cout << endl;
- }
- }
- int main() {
- const int x = 5;
- const int y = 5;
- srand(time(NULL));
- int tablica[x][y];
- for (int i = 0; i < x; i++) {
- for (int j = 0; j < y; j++) {
- tablica[i][j] = rand() % 10 - 5;
- }
- }
- drukujTablice(tablica, x, y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement