JAVA basic programming exercises program [42] 42 digital demand

 

42 program [42] seeking digital

Title: ?? = 809 * 800 * 9 * + ?? 1 + ??

Wherein two digits represented by ??, ?? 8 * result of two digits, 9 * ?? result of 3 bits. ?? representatives seeking double-digit, and the result of 809 * ??.

 

package cskaoyan;

public class cskaoyan42 {
	@org.junit.Test
	public void number() {
		long a = 809;
		long b = 0;

		for (long i = 10; i < 100; i++) {
			b = a * i;

			if (b >= 1000 && b <= 9999 && 8 * i <= 99 && 9 * i >= 100) {
				System.out.println(b + " = 800 * " + i + " + 9 * " + i);
			}
		}
	}
}

 

Guess you like

Origin www.cnblogs.com/denggelin/p/11479063.html
42