fork download
  1. using System;
  2. public class Test {
  3. public static void Main() {
  4. int a = 19;
  5. int c = 27;
  6. int b = 4;
  7. int d = 1;
  8.  
  9. while ((a + b) < (c - d) ) {
  10. a+=b;
  11. c-=d;
  12.  
  13. }
  14. int newA = a + b;
  15. int newC = c - d;
  16. int res = 0;
  17. if (newA < c) {
  18. res = Math.Max(newA, newC);
  19. }
  20. else res = Math.Max(a, c);
  21. Console.Write(res);
  22. }
  23. }
Success #stdin #stdout 0.01s 131776KB
stdin
Standard input is empty
stdout
26