Mutlu GÜNER
- 5 Eyl 2017
- 31 Mesaj
Aktiflik
Seviye
Deneyim
PHP:
private **** button1_Click(object sender, EventArgs e)
    {
      long x;
      int n; Â
      try  Â
      {
        x = int.Parse(textBox1.Text);
        n = int.Parse(textBox2.Text);
        lblSonuc.Text = tabancevir(x,n);
      Â
      }
      catch (Exception)
      {
       Â
        throw;
      }
    }
    string tabancevir(long x, int n) {
    if(n<2)
      return "-1";
    long b;
    string s = "";
    while (x >= n) {
      b = x % n; Â
      x = x / n;
      if (b > 9)
        s = (char)(55 + b) + s;
      else
        s = b + s;
   Â
   Â
    }
   Â
    if (x > 9)
s = (char)(55 + x) + s;
else
s = x + s;
return s;
}
    }
  }

