Guest User

Untitled

a guest
Sep 27th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. int main()
  6. {
  7.     std::vector<bool> v;
  8.     v.resize(99);
  9.     unsigned amount = 0, value = 1;
  10.  
  11.     while (value != 0) {
  12.         std::cout << "Enter your numbers: ";
  13.         for (int i = 0; i < 10; ++i) {
  14.             std::cin >> value;
  15.             if (value == 0) break;
  16.             if (value > 99) continue;
  17.             v[value-1] = true;
  18.         }
  19.         std::cout << "One more time? ";
  20.         std::cin >> value;
  21.     }
  22.     if (std::all_of(v.cbegin(), v.cend(), [](bool b){ return b; })) {
  23.         amount = 1000;
  24.     }
  25.     std::cout << "Winning amount: " << amount << std::endl;
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment