fork download
  1. #include<iostream>
  2. #include<vector>
  3. using namespace std;
  4.  
  5. void imprime(vector<vector<double>> X) {
  6. int linhas = X.size();
  7. for (int i = 0; i < linhas; i++) {
  8. int colunas = X[0].size();
  9. for (int j = 0; j < colunas; j++) cout << X[i][j] << "\t";
  10. cout << endl;
  11. }
  12. }
  13.  
  14. int main() {
  15. vector<vector<double>> X {
  16. {1.0, 2.0, 3.0,2.5},
  17. {2.0, 5.0,-1.0,2.0},
  18. {-1.5,2.7,3.3,-0.8}
  19. };
  20. imprime(X);
  21. }
  22.  
  23. //https://pt.stackoverflow.com/q/451932/101
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
1	2	3	2.5	
2	5	-1	2	
-1.5	2.7	3.3	-0.8