*
The moose likes Programming Diversions and the fly likes number puzzle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "number puzzle" Watch "number puzzle" New topic
Author

number puzzle

vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
2_5_8_3_6=10

substitute any mathematical operators such that leftside equals to ten
fred Joly
Ranch Hand

Joined: Jan 19, 2006
Posts: 55
are parentheses allowed ?
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
are parentheses allowed ?


No
Arjunkumar Shastry
Ranch Hand

Joined: Feb 28, 2005
Posts: 986
If sequencing is not strict,then
8+3+6-2-5 = 10


Namma Suvarna Karnataka
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
If sequencing is not strict


No Sequence is very Strict
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Is _2_5_8_3_6=10 allowed?

- 2 - 5 + 8 + 3 + 6 = 10


http://home.arcor.de/hirnstrom/bewerbung
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Is _2_5_8_3_6=10 allowed?


No.Before number 2 no symbols allowed.
fred Joly
Ranch Hand

Joined: Jan 19, 2006
Posts: 55
Do we use Operator Precedence like in Java or simply
from left to right ?

example : 3+4*2 = 11 in Java
3+4*2 = 14 from left to right
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Left to right only
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1011
    
    3
Originally posted by vidya sagar:
2_5_8_3_6=10

substitute any mathematical operators such that leftside equals to ten


2-5+8/3*6=10 (Left-to-right, no operator precedence.)
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Well Done Ryan McGuire...

That only i expected???

fred Joly
Ranch Hand

Joined: Jan 19, 2006
Posts: 55
Yes, well done!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: number puzzle