diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-10-24 07:56:07 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-10-24 07:56:07 +0000 |
| commit | 3a5f406ff59a05c0eddda191127d58b39cb8049b (patch) | |
| tree | f3ff6adfea30fba8271dedc81d7d652737ae397e /boca-1.5.2/doc/tests/fontes/bits-runtime.pas | |
| parent | 9ae5ead9f89bcc7195420bdf6cc78db2c63dbeda (diff) | |
| download | boca-3a5f406ff59a05c0eddda191127d58b39cb8049b.tar.gz boca-3a5f406ff59a05c0eddda191127d58b39cb8049b.zip | |
open dir for 1.5.2. I still must split devel and master in different branches to properly use git...
Diffstat (limited to 'boca-1.5.2/doc/tests/fontes/bits-runtime.pas')
| -rw-r--r-- | boca-1.5.2/doc/tests/fontes/bits-runtime.pas | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/boca-1.5.2/doc/tests/fontes/bits-runtime.pas b/boca-1.5.2/doc/tests/fontes/bits-runtime.pas new file mode 100644 index 0000000..ed496c0 --- /dev/null +++ b/boca-1.5.2/doc/tests/fontes/bits-runtime.pas @@ -0,0 +1,27 @@ +program bits; +var i, inst, max, n: Longint; + v: array[0..1] of Longint; +begin + while true do + begin + read(n); + if n=0 then break; + max := 1; + for i:=0 to n-1 do + begin + read(v[i]); + if v[i]>max then max:=v[i] + end; + i:=0; + while max>0 do + begin + max := max div 2; + i := i + 1 + end; + write('Instancia '); + inst := inst + 1; + writeln(inst); + writeln(i*n); + writeln() + end +end. |