fork download
  1. program m_mod_k;
  2. var k,m,x,y: integer;
  3.  
  4. begin
  5. read(m,k);
  6. x:=m; y:=k;
  7. while x >= y do
  8. x := x - y;
  9. writeln(m,' mod ',k,' = ', x)
  10. end.
Success #stdin #stdout 0s 5292KB
stdin
25 7
stdout
25 mod 7 = 4