### Code Help Hey guys good morning or good evening or whatever :DDDD

I am doing my school work and I've ran into a problem.
I dont really know how to write the code.

8 - n ( how many lines)
3 4 10 13 ( what numbers need to be removed)The 3 means how many numbers there are.
2 2 11 (what numbers neeed to added back)The 2 means how many numbers there are.
1
3
4
7
9
10
13
14

The equation asks me to remove the numbers and add the other numbers.
The answers should be like this

Nr. 1
Nr. 3
Nr. 7
Nr. 9
Nr. 14

Nr. 1
Nr. 2
Nr. 3
Nr. 7
Nr. 9
Nr. 11
Nr. 14

I don't really know how to start and how to write it. (P.S the addding and removing have to be diff functions);
I know how to remove and add a single number but not multiple :(.
Any help or tips would be great I dont really know how to write the code.
 ``123456789101112131415161718`` ``````#include #include #include int main() { std::cout << "Do you want someone to do all the work for you? "; char answer{}; std::cin >> answer; std::cin.ignore(std::numeric_limits::max(), '\n'); if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; } else { std::cout << "Show what you have coded so far.\n"; } std::cout << "Good luck.\n"; }`````` ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364`` ``````#include #include #include std::vector act() { std::vector nums; size_t num {}; std::cin >> num; for (size_t i {}; i < num; ++i) { int n {}; std::cin >> n; nums.push_back(n); } return nums; } std::multiset getNums(size_t lines) { std::multiset data; for (size_t i {}; i < lines; ++i) { int n {}; std::cin >> n; data.insert(n); } return data; } void addnums(std::multiset& s, const std::vector& v) { for (const auto& n : v) s.insert(n); } void remnums(std::multiset& s, const std::vector& v) { for (const auto& n : v) s.erase(n); } void display(const std::multiset& s) { for (const auto& n : s) std::cout << "Nr. " << n << '\n'; std::cout << '\n'; } int main() { unsigned lines {}; std::cin >> lines; const auto torem {act()}; const auto toadd {act()}; auto data {getNums(lines)}; remnums(data, torem); display(data); addnums(data, toadd); display(data); }``````

 ``` 8 3 4 10 13 2 2 11 1 3 4 7 9 10 13 14 Nr. 1 Nr. 3 Nr. 7 Nr. 9 Nr. 14 Nr. 1 Nr. 2 Nr. 3 Nr. 7 Nr. 9 Nr. 11 Nr. 14 ```

Topic archived. No new replies allowed.