aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-06 09:09:10 +0000
committercassiopc <cassiopc@gmail.com>2012-08-06 09:09:10 +0000
commit866658cded5b92ddb2681dead1ebaf111d712fcc (patch)
treecf7534c4726a142189e096ce82f8d73b2a398ecc /boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp
downloadboca-866658cded5b92ddb2681dead1ebaf111d712fcc.tar.gz
boca-866658cded5b92ddb2681dead1ebaf111d712fcc.zip
init
Diffstat (limited to 'boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp')
-rw-r--r--boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp b/boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp
new file mode 100644
index 0000000..3b38845
--- /dev/null
+++ b/boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp
@@ -0,0 +1,18 @@
+#include <iostream>
+using namespace std;
+int main(void) {
+ int i, j, n, max, inst=0;
+ while(42) {
+ cin >> n;
+ if(!n) break;
+ max=0;
+ for(i=0; i<n; i++) {
+ cin >> j;
+ if(j>max) max=j;
+ }
+ for(i=0; max>0; i++)
+ max >>= 1;
+ cout << "Instancia " << ++inst << endl << (i*n) << endl << endl;
+ }
+ return 0;
+}