Exemple #1
0
 static void genRandom(int cnt, int value) throws IOException {
   ArrayList<Integer> ch = new ArrayList<Integer>();
   ch.add(rand.nextInt(value / cnt));
   for (int i = 1; i < cnt; i++) ch.add(rand.nextInt(value / cnt) + 1 + ch.get(i - 1));
   crypto(ch);
   print();
 }
Exemple #2
0
  static void genNo(int cnt, int value) throws IOException {
    ArrayList<Integer> ch = new ArrayList<Integer>();

    for (int i = 0; i < cnt - 1; i++) ch.add(rand.nextInt(value) + 1);
    ch.add(ch.get(rand.nextInt(cnt - 1)));
    Collections.sort(ch);
    crypto(ch);
    print();
  }