转载:
1 #include2 #include 3 4 using namespace std; 5 6 int main() 7 { 8 vector ivec1, ivec2; 9 int ival,iva2;10 11 cout<<"Enter numbers for vector1(-1 to end): "< > ival;13 while (ival != -1)14 {15 ivec1.push_back(ival);16 cin >> ival;17 }18 cout<<"Enter numbers for vector2(-1 to end): "< > iva2;20 while (iva2 != -1)21 {22 ivec2.push_back(iva2);23 cin >> iva2;24 }25 26 if (ivec1.size() != ivec2.size())27 cout<<"Vector1 is not equal to vector2."<