# Include "stdafx. H "# include <iostream> # include <windows. h> using namespace STD;/* Find all the 90 rings in total for 10 shots, with the number of rings per gun in 1-10 rings */INT result [10] = {0 }; int sum = 0; void display () {for (INT I = 0; I <10; I ++) {cout <result [I] <"";} cout <Endl;} void fun (INT times, int reduce) // The remaining times are being shot, the reduce loop {If (reduce <0 | 10 * Times <reduce) must be played in total. // The number of remaining guns is not enough to return the reduce loop; if (reduce = 0 & times = 0) // The shooting ends {display (); sum ++; // sleep (300); return ;} for (INT I = 10; I> = 1; I --) {result [times-1] = I; // The I ring is played in the countdown times shot, fun (times-1, reduce-I); // In the following times-1 times, the reduce-I ring} int _ tmain (INT argc, _ tchar * argv []) {int times = 10; int reduce = 90; fun (times, reduce); // you need to take 10 shots at the beginning, play the 90-ring cout <sum <Endl; getchar (); Return 0 ;}