fork download
  1. class Test {
  2. public static void main (String[] args) {
  3. int sum = 0, term = 1;
  4. while (sum + term != sum) {
  5. sum = sum + term;
  6. term = term * 2;
  7. }
  8. System.out.println(sum);
  9. }
  10. }
Success #stdin #stdout 0.08s 380160KB
stdin
Standard input is empty
stdout
-1