TXT文件按格式读取!希望大家万忙之中抽点空来帮帮忙解决思路

TXT文件按格式读取!希望大家万忙之中抽点空来帮帮忙
我想对一个TXT文件进行读取操作
TXT文件内容如下
600
2   56
4   85
4   68
9   4






我想将600读入整型变量d中
第一列读入数组a[i]中
第二列读入数组b[i]中

但是我不知到如何读取可以完成这样的功能,望指教。谢谢

------解决方案--------------------
CStdioFile stdFile;

stdFile.Open(file, CFile::modeRead);
CString szContent;
stdFile.ReadString(szContent);
int d = atoi(szContent),
nPos = 0,
nInd = 0;

while( stdFile.ReadString(szContent) )
{
szContent.TrimLeft();
nPos = szContent.Find(_T( " "));
a[nInd] = atoi(szContent.Left(nPos));

szContent.Delete(0, nPos);
szContent.TrimLeft();
b[nInd++] = atoi(szContent);
}

stdFile.Close();
------解决方案--------------------
#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

int main()
{
ifstream ifile( "test.txt ");

int d;
vector <int> a;
vector <int> b;
int v1, v2;

ifile > > d;
while (ifile > > v1 > > v2)
{
a.push_back(v1);
b.push_back(v2);
}

cout < < d < < endl;
for (int i=0; i <a.size(); i++)
cout < < a[i] < < " " < < b[i] < < endl;

return 0;
}