Hello,
I was recently asked this question, and just wanted to pose this to the forum to see what people think is the best solution - post your answers and we can judge on performance, elegance and coding skill.
Thanks
PS - when complete I will post my answer (which isnt the most elegant)
QUESTION:#
In a normal year, February has 28 days, April has 30 and January and May both have 31. Using letters for digits consistently, JAN and MAY are divisible by 31, APR is divisible by 30, and FEB is divisible by 28.
Create a program which uniquely identifies the three-digit number for FEB and writes it to the console screen.
So each letter stands for a single digit, there are ten distinct letters, each representing a unique digit between 0..9.
Thanks
"I'm living so far beyond my income that we may almost be said to be living apart
I was recently asked this question, and just wanted to pose this to the forum to see what people think is the best solution - post your answers and we can judge on performance, elegance and coding skill.
Thanks
PS - when complete I will post my answer (which isnt the most elegant)
QUESTION:#
In a normal year, February has 28 days, April has 30 and January and May both have 31. Using letters for digits consistently, JAN and MAY are divisible by 31, APR is divisible by 30, and FEB is divisible by 28.
Create a program which uniquely identifies the three-digit number for FEB and writes it to the console screen.
So each letter stands for a single digit, there are ten distinct letters, each representing a unique digit between 0..9.
Thanks
"I'm living so far beyond my income that we may almost be said to be living apart