From 866658cded5b92ddb2681dead1ebaf111d712fcc Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 6 Aug 2012 11:09:10 +0200 Subject: init --- boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp (limited to 'boca-1.5.0/doc/tests/fontes/bits-incorrect.cpp') 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 +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> j; + if(j>max) max=j; + } + for(i=0; max>0; i++) + max >>= 1; + cout << "Instancia " << ++inst << endl << (i*n) << endl << endl; + } + return 0; +} -- cgit v1.2.3