Results 1 to 7 of 7

Thread: can this code be optimized?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    277

    can this code be optimized?

    PHP Code:
    import java.io.*;
    public class 
    test {
        public static 
    void main (String[] arg)throws IOException{
            for (
    int a=2;a<10;a++){
                
    PrintWriter out = new PrintWriter(new FileWriter(""+a+".txt"));
                for (
    int b=0;b<10;b++){
                    for (
    int c=0;c<10;c++){
                        for (
    int d=0;d<10;d++){
                            for (
    int e=0;e<10;e++){
                                for (
    int f=0;f<10;f++){
                                    for (
    int g=0;g<10;g++){
                                    
    out.println(""+a+b+c+d+e+f+g);
                                    }
                                }
                            }
                        }
                    }
                }
            
    out.close();
            }    
        
    System.out.println("Done");
        }

    I am wondering to know if this code can be optimized to be faster

    thanks
    Last edited by proff.hacker; Apr 16th, 2003 at 08:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width