|
|
Cool site! There are some problems with encoding though, when I open Petr's code I see it as bellow (RedHat, Firefox).
using System;
public class Multifactorial {
  long INF = 1000000000000000000L;
 Â
  public string calcMultiFact(int n, int k) {
    long res = 1;
    for (int z = n; z > 0; z -= k)
    {
      if (INF / z < res)
        return "overflow";
      res *= z;
    }
    return res.ToString();
  }
}
// Powered by FileEdit
// Powered by TZTester 1.01 [25-Feb-2003] [modified for C# by Petr]
// Powered by CodeProcessor
|