Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int result;
- cin >> result;
- vector<int> points;
- for (int i = 0; i <= 20; i++)
- {
- points.push_back(i); // zero plus points from single sector
- }
- for (int i = 1; i <= 20; i++)
- {
- points.push_back(3 * i); // points from tripple sector
- }
- points.push_back(25); // outer circle
- for (int i = 1; i <= 20; i++)
- {
- points.push_back(2 * i);
- }
- points.push_back(50); // inner circle (bullseye)
- //std::cout << points[42]; from here starts the double sector shots
- size_t counter = 0;
- for (size_t i = 0; i < points.size(); i++)
- {
- if (points[i] == result && i >= 42)
- {
- counter++;
- }
- for (size_t j = 0; j < points.size(); j++)
- {
- if (points[i] + points[j] == result && j >= 42)
- {
- counter++;
- }
- for (size_t m = 0; m < points.size(); m++)
- {
- if (points[i] + points[j] + points[m]==result && m >= 42)
- {
- counter++;
- }
- }
- }
- }
- cout << counter;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement