fork(2) download
  1. program kowal;
  2.  
  3. var
  4. tab : array [0..24] of byte;
  5. getsuc,newsuc,lvl,d:integer;
  6. fortune:byte;
  7.  
  8. BEGIN
  9. randomize;
  10. repeat
  11. tab[0]:=100;
  12. tab[1]:=100;
  13. tab[2]:=100;
  14. tab[3]:=75;
  15. tab[4]:=100;
  16. tab[5]:=45;
  17. tab[6]:=90;
  18. tab[7]:=30;
  19. tab[8]:=75;
  20. tab[9]:=15;
  21. tab[10]:=45;
  22. tab[11]:=38;
  23. tab[12]:=8;
  24. tab[13]:=30;
  25. tab[14]:=8;
  26. tab[15]:=23;
  27. tab[16]:=5;
  28. tab[17]:=15;
  29. tab[18]:=5;
  30. tab[19]:=12;
  31. tab[20]:=3;
  32. tab[21]:=9;
  33. tab[22]:=3;
  34. tab[23]:=8;
  35. tab[24]:=0;
  36. getsuc:=0;
  37. newsuc:=0;
  38. lvl:=0;
  39. fortune:=0;
  40. d:=0;
  41.  
  42. read(lvl,fortune);
  43.  
  44. if lvl<24 then
  45. begin
  46. getsuc:=random(99);
  47. newsuc:=tab[lvl]*fortune;
  48.  
  49. if getsuc <= newsuc then
  50. begin
  51. d:=random(3)+1;
  52. lvl:=lvl+d;
  53. if lvl > 24 then lvl:=24;
  54. end;
  55.  
  56. if getsuc >= newsuc then
  57. begin
  58. d:=random(2)+1;
  59. lvl:=lvl-d;
  60. end;
  61. end;
  62.  
  63. writeln(lvl);
  64.  
  65. until eof;
  66. {BY TOMECZKOO!!!!!}
  67. END.
Success #stdin #stdout 0s 276KB
stdin
Standard input is empty
stdout
-2