Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void solve() {
  2.                 int a = nextInt();
  3.                 int b = nextInt();
  4.                 int c = nextInt();
  5.                 int d = nextInt();
  6.                 int e = nextInt();
  7.                 int f = nextInt();
  8.                 if (a != 0 && c != 0 && e != 0) {
  9.                         out.println(a * c * e < b * d * f ? "Ron" : "Hermione");
  10.                         return;
  11.                 }
  12.                 if (e == 0 && f > 0 || (c == 0 && d > 0 && f > 0)
  13.                                 || (a == 0 && b > 0 && d > 0 && f > 0)) {
  14.                         out.println("Ron");
  15.                         return;
  16.                 } else {
  17.                         out.println("Hermione");
  18.                         return;
  19.                 }
  20.         }