Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- int main()
- {
- std::vector<bool> v;
- v.resize(99);
- unsigned amount = 0, value = 1;
- while (value != 0) {
- std::cout << "Enter your numbers: ";
- for (int i = 0; i < 10; ++i) {
- std::cin >> value;
- if (value == 0) break;
- if (value > 99) continue;
- v[value-1] = true;
- }
- std::cout << "One more time? ";
- std::cin >> value;
- }
- if (std::all_of(v.cbegin(), v.cend(), [](bool b){ return b; })) {
- amount = 1000;
- }
- std::cout << "Winning amount: " << amount << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment