if ((c>b&&b>d)||(d>b&&b>c)) printf("Case %d: %d\n", i, b); else if ((b>c&&c>d)||(d>c&&c>b)) printf("Case %d: %d\n", i, c); else printf("Case %d: %d\n", i, d);