Java
JAVA
I I was inspired from the sample of how not to do it.
class TheNumbers
{
public static void main(String[] args) {
int FOUR = 9+9-7-7;
int EIGHT = 9+9-7-7 + 9+9-7-7;
int FIFTEEN = (9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9 - 7)/(9-7);
int SIXTEEN = 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7;
int TWENTY_THREE = (9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9-7 + 9-7+ 9-7)/(9-7);
int FOURTY_TWO = 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7+9+9-7-7 + 9+9-7-7 + 9+9-7-7 + 9-7;
for(int n = 0;;) System.out.println(
n == FOUR ? n = EIGHT :
n == EIGHT ? n = FIFTEEN :
n == FIFTEEN ? n = SIXTEEN :
n == SIXTEEN ? n = TWENTY_THREE :
n == TWENTY_THREE ? n = FOURTY_TWO : (n = FOUR)
);
}
}
}
Edited so that I do not use the numbers 1,2,3,4,5,6,8,0 anywhere. I originally had things like 14+1 to avoid using 15, but there is a 1 and a 4 that I am not allowed to use.
Sweet, I got upvotes?! I thought this would be ignored or even possibly downvoted xD <3