Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
base de conocimientomiarbol
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
arbol :- write('ARBOL('),read(X),write(X),write(')'),aux1. aux1 :- read(X),(X='rama'->rama; X='fin' ->write('')). rama :- write('RAMA('),read(X),write(X),write(')'),aux2,aux1. aux2 :- read(X),(X='hoja'->hoja; X='fin' ->write('')). hoja :- write('HOJA('),read(X),write(X),write(')'),aux2. :- arbol.
miarbol. rama. r1. hoja. h1. hoja. h2. fin. rama. r2. hoja. h1. hoja. h2. hoja. h3. fin. fin.
[
-
]
Show input
Absolute running time: 0.29 sec, cpu time: 0.19 sec, memory peak: 7 Mb, absolute service time: 0,47 sec
edit mode
|
history
|
discussion
ARBOL(miarbol)RAMA(r1)HOJA(h1)HOJA(h2)RAMA(r2)HOJA(h1)HOJA(h2)HOJA(h3)