Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void create ()
- {
- for(int i = 0; i < size; i++)
- {
- rand = new Random ();
- v[i] = rand.nextInt(900);
- }
- print_array((char) 0);
- }
- public void print_array(char mode)
- {
- if (mode == 'f')
- {
- try
- {
- output = new PrintWriter (new File ("fil.txt"));
- }
- catch (Exception E)
- {
- System.err.println(E.getMessage());
- }
- for(int i=0;i<size;i++)
- ((PrintWriter) output).println(v[i]);
- output.close( );
- }
- for(int i = 0; i <size; i++)
- {
- System.out.print(v[i] + " ");
- if ( i%10 == 9)
- {
- System.out.println ("");
- }
- }
- }
Add Comment
Please, Sign In to add comment