summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing2206.java
blob: b96a3fd0309c0243f82297ef9312734b8d16e1cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Listing2206.java */

import java.io.*;

public class Listing2206
{
  public static void main(String[] args)
  {
    PrimeNumberTools pt = new PrimeNumberTools();
    BufferedReader   in = new BufferedReader(
                          new InputStreamReader(
                          new DataInputStream(System.in)));
    int num;

    try {
      while (true) {
        System.out.print("Bitte eine Zahl eingeben: ");
        System.out.flush();
        num = (new Integer(in.readLine())).intValue();
        if (num == -1) {
          break;
        }
        pt.printPrimeFactors(num);
      }
    } catch (IOException e) {
      //nichts
    }
  }
}