Advertisement
Josif_tepe

Untitled

Jun 1st, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n;
  8. int matrica[n][n];
  9. for(int i = 0; i < n; i++) {
  10. for(int j = 0; j < n; j++) {
  11. cin >> matrica[i][j];
  12. }
  13. }
  14. for(int i = 0; i < n; i++) {
  15. matrica[i][i] = 0;
  16. }
  17. for(int i = 0; i < n; i++) {
  18. for(int j = 0; j < n; j++) {
  19. cout << matrica[i][j] << " ";
  20. }
  21. cout << endl;
  22. }
  23. return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement