64,637
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
#include<iostream>
#include<vector>
using namespace std;
int main(array<System::String ^> ^args)
{
vector<double> val;
double tmp;
vector<double>::iterator start_pos;
start_pos=val.begin();
cin>>tmp;
if ( cin.bad( )==true )
{
cerr<<"bad input "<<endl;
exit( 1 );
}
else if (cin.fail()==true )
{
cerr<<" value type invaild "<<endl;
cin.clear( cin.rdstate() );
}
else
val.push_back(tmp);
copy( val.begin(), val.end(), ostream_iterator<double>(cout, " ") );
system("pause");
return 0;
}