Skip to content

Instantly share code, notes, and snippets.

@iporsut
Created June 7, 2011 19:22
Show Gist options
  • Save iporsut/1012940 to your computer and use it in GitHub Desktop.
Save iporsut/1012940 to your computer and use it in GitHub Desktop.
Digit Solve
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