Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
doc /
play /
[ HOME SHELL ]
Name
Size
Permission
Action
fib.go
306
B
-rw-r--r--
hello.go
133
B
-rw-r--r--
life.go
2.44
KB
-rw-r--r--
peano.go
1.45
KB
-rw-r--r--
pi.go
598
B
-rw-r--r--
sieve.go
762
B
-rw-r--r--
solitaire.go
2.62
KB
-rw-r--r--
tree.go
1.96
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : peano.go
// Peano integers are represented by a linked // list whose nodes contain no data // (the nodes are the data). // http://en.wikipedia.org/wiki/Peano_axioms // This program demonstrates that Go's automatic // stack management can handle heavily recursive // computations. package main import "fmt" // Number is a pointer to a Number type Number *Number // The arithmetic value of a Number is the // count of the nodes comprising the list. // (See the count function below.) // ------------------------------------- // Peano primitives func zero() *Number { return nil } func isZero(x *Number) bool { return x == nil } func add1(x *Number) *Number { e := new(Number) *e = x return e } func sub1(x *Number) *Number { return *x } func add(x, y *Number) *Number { if isZero(y) { return x } return add(add1(x), sub1(y)) } func mul(x, y *Number) *Number { if isZero(x) || isZero(y) { return zero() } return add(mul(x, sub1(y)), x) } func fact(n *Number) *Number { if isZero(n) { return add1(zero()) } return mul(fact(sub1(n)), n) } // ------------------------------------- // Helpers to generate/count Peano integers func gen(n int) *Number { if n > 0 { return add1(gen(n - 1)) } return zero() } func count(x *Number) int { if isZero(x) { return 0 } return count(sub1(x)) + 1 } // ------------------------------------- // Print i! for i in [0,9] func main() { for i := 0; i <= 9; i++ { f := count(fact(gen(i))) fmt.Println(i, "! =", f) } }
Close