Example #1
0
    public void diff(int id, String small, String large) {
      try {
        Scanner sm = new Scanner(new File(small));
        Scanner lg = new Scanner(new File(large));
        int line = 0;
        while (sm.hasNextLine() && lg.hasNextLine()) {
          String s = sm.nextLine();
          String l = lg.nextLine();
          if (!s.equals(l)) {
            System.out.println(line + ">" + s);
            System.out.println(line + "<" + l);
          }
          line++;
        }

      } catch (Exception e) {
        e.printStackTrace();
      }
    }
Example #2
0
 public void run() {
   Scanner sc = new Scanner(System.in);
   int T = sc.nextInt();
   sc.nextLine();
   for (int t = 1; t <= T; t++) System.out.printf("Case #%s: %s%n", t, solve(sc));
 }