預設顯示:
// vector.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include
#include
using namespace std; int show(vector
> var) { cout << "the size of matrix is " << var.size() << "*" << var[0].size() << endl; return 0; } int main(int argc, char* argv[]) { //二維動態陣列的宣告 int x,y; cin>>x>>y; vector
> matrix(x,vector
(y)); show(matrix); return 0; }
預設不顯示:
// vector.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include
#include
using namespace std; int show(vector
> var) { cout << "the size of matrix is " << var.size() << "*" << var[0].size() << endl; return 0; } int main(int argc, char* argv[]) { //二維動態陣列的宣告 int x,y; cin>>x>>y; vector
> matrix(x,vector
(y)); show(matrix); return 0; }