1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include <iostream>
#include <vector>
void Print2DVector(std::vector<std::vector<int>>&);
int main()
{
std::vector<std::vector<int>> grades { { 86, 77, 98, 67, 79 },
{ 89, 67, 78, 64, 72 },
{ 65, 86, 63, 90, 70 },
{ 92, 87, 84, 79, 81 },
{ 89, 95, 77, 72, 70 },
{ 77, 70, 68, 81, 69 } };
Print2DVector(grades);
}
void Print2DVector(std::vector<std::vector<int>>& vec)
{
for (auto& rows : vec)
{
for (auto& cols : rows)
{
std::cout << cols << ' ';
}
std::cout << '\n';
}
}
|