Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int comb_num;
- cin >> comb_num;
- int comb_count = 0;
- for (char pos1 = 'B'; pos1 <= 'L'; pos1+=2)
- {
- for (char pos2 = 'f'; pos2 >= 'a'; pos2--)
- {
- for (char pos3 = 'A'; pos3 <= 'C'; pos3++)
- {
- for (int num1 = 1; num1 <= 10; num1++)
- {
- for (int num2 = 10; num2 >= 1; num2--)
- {
- comb_count++;
- if (comb_count == comb_num)
- {
- cout << "Ticket combination: " << pos1 << pos2 << pos3 << num1 << num2 << endl;
- int prize = pos1 + pos2 + pos3 + num1 + num2;
- cout << "Prize: " << prize << " lv.\n";
- return 0;
- }
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment