Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void wyswietl(int wysokosc, int szerokosc, int **tab)
- {
- if (tab == NULL)
- return;
- for (int i = 0; i < wysokosc; i++)
- {
- for (int j = 0; j < szerokosc; j++)
- {
- cout << tab[i][j] << " ";
- }
- cout << endl;
- }
- }
- int main()
- {
- int wysokosc = 4;
- int szerokosc = 7;
- // Deklaracja tablicy
- int **tablica = new int *[wysokosc];
- for (int i = 0; i < wysokosc; i++)
- {
- tablica[i] = new int [szerokosc];
- }
- // Inicjalizacja zmiennych danymi
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 7; j++)
- {
- tablica[i][j] = i + j * j;
- }
- }
- // Uzycie funkcji
- wyswietl(wysokosc, szerokosc, tablica);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement