C++中怎么用二维向量读取TXT 中的数据

C++中如何用二维向量读取TXT 中的数据?
229 219 199 216 235 255 266 285 272 241 246 281 284 275 261 273
221 214 195 216 234 258 273 289 281 249 259 278 287 272 275 277
213 203 196 206 221 232 259 293 294 277 258 285 287 283 288 286
204 195 200 201 209 218 231 259 288 306 286 291 301 311 319 298
196 207 201 211 239 234 241 259 294 315 317 321 325 322 325 341
208 218 204 214 235 260 239 268 298 291 331 313 281 280 280 280
216 231 218 196 220 255 271 253 264 303 322 312 276 243 238 239
236 242 218 198 200 215 224 238 261 294 324 312 280 255 220 200
255 241 219 211 206 225 252 275 284 285 305 316 271 237 208 191
245 218 207 198 214 241 261 256 273 276 291 298 281 238 197 175
225 215 205 195 208 221 235 252 262 271 301 275 245 212 181 171
数据如以上 假设存放在a.txt的文件中 要存放在一个二维向量中

求各位给个详细的代码看看
------解决思路----------------------

/**
 * @file        array.c
 * @brief
 */

#include <stdio.h>

#define ROWS    11
#define COLS    16

int main(int argc, char *argv[])
{
        int i, j;
        FILE *fp;
        int array[ROWS][COLS];

        fp = fopen("array.txt", "rb");

        for (i = 0; i < ROWS; ++i) {
                for (j = 0; j < COLS; ++j)
                        fscanf(fp, "%d", &array[i][j]);
        }

        fclose(fp);

        for (i = 0; i < ROWS; ++i) {
                for (j = 0; j < COLS; ++j)
                        printf("%d ", array[i][j]);
                printf("\n");
        }

        return 0;
}

------解决思路----------------------
向量可以存储二位数据吗?
不知道这样行不行,反正编译运行是没问的!

#include <vector>
void test_vector()
{
typedef std::vector<int> mv;
std::vector<mv> myv2;
mv data,data2;
data.push_back(1);
data.push_back(2);
data2.push_back(11);
data2.push_back(22);
myv2.push_back(data);
myv2.push_back(data2);
myv2.at(1).at(1);
}

------解决思路----------------------
http://bbs.****.net/topics/360055953
------解决思路----------------------

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;

typedef vector<int>          OneDimension;
typedef vector<OneDimension> TwoDimension;

void Display (TwoDimension const& t)
{
   for (TwoDimension::size_type i = 0; i < t.size(); ++i)
   {
      for (OneDimension::size_type j = 0; j < t[i].size(); ++j)
      {
         cout << t[i][j] << " ";
      }
      cout << endl;
   }
}

int main (int const argc, char const* argv[])
{
   TwoDimension v2;
   ifstream     f("a.txt");

   if (!f)
   {
      cerr << "open a.txt failed" << endl;
      return (-1);
   }

   string s;
   int    t;
   while (getline(f, s))
   {
      istringstream is(s);
      OneDimension  v1;

      while (is >> t)
      {
         v1.push_back(t);
      }
      v2.push_back(v1);
   }
   f.close();

   Display(v2);

   cin.get();
   return (0);
}

------解决思路----------------------
读入整块内存,按二维访问就行了,类似于位图
------解决思路----------------------
#include<iostream>
#include<fstream>
#include<sstream>
#include<vector>
using namespace std;
typedef vector<vector<int> >  Mat;
Mat input();
void mySort(Mat& a);
void print(const Mat& a);
int mian(){
 Mat a=input();
 mySort(a);
 print(a);
 return 0;
}
Mat input(){
 ifstream in("aaa.txt");
 Mat a;
 for(string s;getline(in,s);){
 vector<int>b;
 istringstream sin(s);
for(int ia;sin>>ia;)
  b.push_back(ia);
a.push_back(b);
}
return a;
}
void mySort(Mat&a){
 for(int pass=1;pass<a.size();pass++)
 for(int i=0;i<a.size()-pass;i++)
 if(a[i+1].size()<a[i].size())a[i].swap(a[i+1]);

}
void print(const Mat& a){
for(int i=0;i<a.size();i++)
for(int j=0;j<a.size();j++)
cout<<a[i][j]<<endl;


}各位大神,这个程序为什么运行报错,求解,拜托了,小女子初学c++很是艰难,谢谢