Created
June 7, 2011 19:22
-
-
Save iporsut/1012940 to your computer and use it in GitHub Desktop.
Digit Solve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Solve { | |
public static void main(String [] args) { | |
int T = 0,O = 0,G = 0,D = 0; | |
int temp; | |
for (int oo = 3; oo <= 9; oo++) { | |
if ( ((((4*oo)+(40*oo)) % 100) / 10) == oo) { | |
temp = ((4*oo)+(40*oo)); | |
for (int tt = 1; tt <= 9; tt++) { | |
if ( (((((400*tt) + temp)) / 100) % 10) == oo) { | |
int result = (400*tt) + temp; | |
T = tt; | |
O = oo; | |
G = result / 1000; | |
D = result % 10; | |
break; | |
} | |
} | |
} | |
} | |
System.out.println("T = "+T); | |
System.out.println("O = "+O); | |
System.out.println("G = "+G); | |
System.out.println("D = "+D); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment