fork download
  1. proc divmod(a, b: int; res, remainder: var int) =
  2. res = a div b # 整数型の除算
  3. remainder = a mod b # 整数型のmod計算
  4.  
  5. var
  6. x, y: int
  7. divmod(8, 5, x, y) # xとyを変更する
  8. echo x
  9. echo y
Success #stdin #stdout 0s 2432KB
stdin
Standard input is empty
stdout
1
3