aboutsummaryrefslogtreecommitdiff
path: root/doc/tests/fontes/bits-incorrect.cpp
blob: 3b38845d9a5dc3b1af4f729e00382140a16b0fb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}