fork download
  1. class Main {
  2. public static void printIndices(int i, int a, int b, int c) {
  3. System.out.println(i%a + ", " + (i/a)%b + ", " + (i/a/b)%c);
  4. }
  5.  
  6. public static void main(String[] args) {
  7. int a[] = new int[2];
  8. int b[] = new int[2];
  9. int c[] = new int[3];
  10.  
  11. int iterations = a.length * b.length * c.length;
  12.  
  13. for (int i=0; i < iterations; i++){
  14. printIndices(i, a.length, b.length, c.length);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
0, 0, 0
1, 0, 0
0, 1, 0
1, 1, 0
0, 0, 1
1, 0, 1
0, 1, 1
1, 1, 1
0, 0, 2
1, 0, 2
0, 1, 2
1, 1, 2