Transposed matrix P27498


Statement
 

pdf   zip   main.cc   main.java   main.py

html

Write a procedure that transposes a square matrix m.

Interface

C++
typedef vector< vector<int> > Matrix;
 
void transpose(Matrix& m);
Java
public static void transpose(int[][] m);
Python
transpose(m) # returns None
 
transpose(m: list) -> None

Precondition

m is a square matrix n× n with n≥0.

Information
Author
Jordi Petit
Language
English
Translator
Carlos Molina
Original language
Catalan
Other languages
Catalan
Official solutions
C++ Java Python
User solutions
C++ Java