文件名称:Arithmetically-Challenged
介绍说明--下载内容均来自于网络,请自行研究使用
题意就是给你四个数,运用算术运算,找出它的所有可能值的连续最长的起始值和终了值,如果有想同的最大长度,输出较大的。-Challenge 24 is a popular mathematics game used in many grade schools. In each game, contestants are given a card with four positive integers i1, i2, i3, i4 on it, and the first one who can use all of these numbers and any combination of the four basic arithmetic operations to get 24 wins. Each of the numbers i1, i2, i3, i4 must be used exactly once. Division can be used only if the divisor evenly divides the dividend (i.e., you can perform 6/2 but not 6/4). For example, if the card contains the numbers 7, 2, 5 and 1, possible solutions are (7-2)*5-1 or (7+1)*(5-2). Hmmm . . . this sounds like a source of a good programming problem.
Write a program that determines the longest consecutive sequence of integers that can be obtained by different ways of arithmetically combining the four integers. For example, with 7, 2, 5 and 1 the longest consecutive sequence is-18 to 26 (yes, we re allowing final results to be negative). The "+" and "-" operators must be used as binary operators, not
Write a program that determines the longest consecutive sequence of integers that can be obtained by different ways of arithmetically combining the four integers. For example, with 7, 2, 5 and 1 the longest consecutive sequence is-18 to 26 (yes, we re allowing final results to be negative). The "+" and "-" operators must be used as binary operators, not
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Arithmetically Challenged.cpp
Arithmetically Challenged.exe