aboutsummaryrefslogtreecommitdiff
path: root/doc/tests/fontes/bits-yes.cpp
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2013-07-02 05:46:45 +0000
committercassio <cassiopc@gmail.com>2013-07-02 05:46:45 +0000
commitbe2491b093b1f0ca430bede679ecbb670041e483 (patch)
treefe2da63d1811cb93e4352a43a113ace37b9f6017 /doc/tests/fontes/bits-yes.cpp
parenta9aa438ea0558eb0044cf1e54a9190ddb41b65e5 (diff)
downloadboca-be2491b093b1f0ca430bede679ecbb670041e483.tar.gz
boca-be2491b093b1f0ca430bede679ecbb670041e483.zip
restructuring of boca's git
Diffstat (limited to 'doc/tests/fontes/bits-yes.cpp')
-rw-r--r--doc/tests/fontes/bits-yes.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/tests/fontes/bits-yes.cpp b/doc/tests/fontes/bits-yes.cpp
new file mode 100644
index 0000000..11a32b5
--- /dev/null
+++ b/doc/tests/fontes/bits-yes.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=1;
+ 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;
+}