总时间限制:
1000ms
内存限制:
65536kB
// 在此处补充你的代码
描述
模仿C++标准模板库istream_iterator用法,实现CMyistream_iterator使得程序按要求输出
#include <iostream> #include <string> using namespace std; template <class T> class CMyistream_iterator {
}; int main() { int t; cin >> t; while( t -- ) { CMyistream_iterator<int> inputInt(cin); int n1,n2,n3; n1 = * inputInt; //读入 n1 int tmp = * inputInt; cout << tmp << endl; inputInt ++; n2 = * inputInt; //读入 n2 inputInt ++; n3 = * inputInt; //读入 n3 cout << n1 << " " << n2<< " " << n3 << " "; CMyistream_iterator<string> inputStr(cin); string s1,s2; s1 = * inputStr; inputStr ++; s2 = * inputStr; cout << s1 << " " << s2 << endl;