C ++ Primer Learning Notes About Exercise 6.12

xiaoxiao2021-03-06  72

Write a program so that it accepts the following definitions: int IA [] = {0, 1, 2, 3, 5, 8, 13, 21, 55, 89}; list ilist (IA, IA 11) Erase () in the form of a single Iterator () deletes the elements of all odd locations in the ilist. #include #include #include using namespace std; int main () {Int IA [] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 55, 89}; List ilist (IA, IA 11); for (int i = 0; i <11; i) {cout << * (IA i); cout << ";} Cout << "/ n";

IList.Remove_if (Bind2nd (Modulus (), 2)); List ilist1 = ilist; list :: item = = ilist1.begin (); cout << ilist1.front (); while (iter! = ilist1.end ()) {cout << * iter << ",";}} This program is completely wrong, do you know why? Said to laugh, explain it, I really don't know how to say! Waiting for me to explain the appropriate vocabulary. I have been suspected that this question, Mr. Lippman is not too outrageous! !

转载请注明原文地址:https://www.9cbs.com/read-91805.html

New Post(0)