옵션 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #include <algorithm> #include <vector> #include <iostream> using namespace std; class MutaliskEasy{ public: bool Pred(int x){ return x <= 0; } int minimalAttacks(vector <int> x){ int attack_count = 0; vector<int>::iterator iter1; vector<int>::iterator iter2; vector<int>::iterator iter3; while (x.size() != 0) { if (x.size() == 3){ for (iter2 = x.begin(); iter2 != max_element(x.begin(), x.end()) || iter2 != min_element(x.begin(), x.end()); iter2++); iter1 = max_element(x.begin(), x.end()); iter3 = min_element(x.begin(), x.end()); *iter1 -= 9; *iter2 -= 3; *iter3 -= 1; attack_count++; } else if (x.size() == 2){ iter1 = max_element(x.begin(), x.end()); iter2 = min_element(x.begin(), x.end()); *iter1 -= 9; *iter2 -= 3; attack_count++; } else{ iter1 = x.begin(); *iter1 -= 9; attack_count++; } remove_if(x.begin(), x.end(), Pred); } return attack_count; } }; | cs |
48번 줄 remove_if함수에서 오류 error C3867: 'MutaliskEasy::Pred': 함수 호출에 인수 목록이 없습니다. '&MutaliskEasy::Pred'을(를) 사용하여 멤버에 대한 포인터를 만드십시오.