File: nestedloop.java

package info (click to toggle)
groovy2 2.2.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 23,916 kB
  • sloc: java: 136,570; xml: 948; sh: 486; makefile: 67; ansic: 64
file content (20 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// $Id: nestedloop.java,v 1.1 2004-05-23 07:14:28 bfulgham Exp $
// http://www.bagley.org/~doug/shootout/

import java.io.*;
import java.util.*;

public class nestedloop {
    public static void main(String args[]) throws IOException {
        int n = Integer.parseInt(args[0]);
        int x = 0;
        for (int a=0; a<n; a++)
            for (int b=0; b<n; b++)
                for (int c=0; c<n; c++)
                    for (int d=0; d<n; d++)
                        for (int e=0; e<n; e++)
                            for (int f=0; f<n; f++)
                                x++;
        System.out.println(x);
    }
}