Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void inputMatrix(std::vector<std::vector<float>>& matrix, int height, int width) {
- matrix.resize(height);
- for (int co = 0; co < height; ++co) {
- matrix[co].resize(width);
- for (int cou = 0; cou < width; ++cou) {
- cin >> matrix[co][cou];
- }
- }
- }
- void outputMatrix(const std::vector<std::vector<float>>& matrix) {
- int height = matrix.size();
- if (height == 0) return;
- int width = matrix[0].size();
- cout << '\n';
- for (int co = 0; co < height; ++co) {
- for (int cou = 0; cou < width; ++cou) {
- cout << matrix[co][cou] << " ";
- }
- cout << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement