2. The first write formulas in math, then into the formula in the program
CodePudding user response:
2 formula is n * (n - 1)/2 write code type n, then the output out
3 3 * 5 * 7, a total of 105 kinds of circumstances, to do loop from 1 to 105, look is more than a few meet in addition to the three 2, divided by 5 more than 3, divided by 7 more than 2; Assume that this number is n Subtract with 2395 and 2333, respectively, n, and see which one is 105 multiples, which one is it, Meet, divided by the number of the condition of a few more than a few 105 x + n Of course, you can directly in 2395 and 2333 directly to remove the remainder whether meet the condition