Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- cout << "Podaj rozmiar tablicy kwadratowej" << endl;
- cin >> x;
- int matrix[x][x];
- for(int i=0; i<x; i++)
- {
- for(int j=0; j<x; j++)
- {
- if(i==j)
- {
- matrix[i][j]=0;
- }
- else
- {
- matrix[i][j]=1;
- }
- cout << matrix[i][j] << " ";
- }
- cout << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment