fork download
  1. program ideone;
  2. var X, N, Y: integer;
  3. begin
  4. readln(X);
  5. readln(N);
  6. Y := X mod round(exp(ln(10)*N));
  7. writeln(Y);
  8. end.
Success #stdin #stdout 0s 2004KB
stdin
123456
3
stdout
456