#include <stdio.h>

#include <iostream>

#include <stdlib.h>

#include <unistd.h>

#include <fcntl.h>

int mypow (int b, int exp)

{

int res = b;

if (exp==0)

return 1;

while (exp>1)

{

res = res * b;

exp --;

}

return res;

}

int main (void)

{

#ifndef ONLINE_JUDGE

close (0); open ("10019.in", O_RDONLY);

close (1); open ("10019.out", O_WRONLY | O_CREAT, 0600);

#endif

int n, i;

int number[256], dimn;

char achar;

int X1, X2;

unsigned int b1, b2;

cin >> n;

scanf ("%c", &achar); /* skip new line */

while (n>0)

{

n--;

dimn=0;

scanf ("%c", &achar);

while (achar!='\n')

{

number[dimn] = achar - 48;

dimn++;

scanf("%c", &achar);

}

X1 = X2 = 0;

for (i=0; i<dimn; i++)

{

X1 += number

** mypow(10, dimn-i-1);*

X2 += number

X2 += number

** mypow(16, dimn-i-1);*

}

b1 = b2 = 0;

for (i=0; i<14; i++)

{

if ( ( X1 & (1<<i) ) == (1<<i) )

b1++;

if ( ( X2 & (1<<i) ) == (1<<i) )

b2++;

}

cout << b1 << " " << b2 << endl;

}

return 0;

}

the problem seem to be in these lines:

while (achar!='\n')

{

number[dimn] = achar - 48;

dimn++;

scanf("%c", &achar);

}

uhmmm but what is wrong on these lines ? ...

thanks for reading my orrible english!

good night

GiGi}

b1 = b2 = 0;

for (i=0; i<14; i++)

{

if ( ( X1 & (1<<i) ) == (1<<i) )

b1++;

if ( ( X2 & (1<<i) ) == (1<<i) )

b2++;

}

cout << b1 << " " << b2 << endl;

}

return 0;

}

the problem seem to be in these lines:

while (achar!='\n')

{

number[dimn] = achar - 48;

dimn++;

scanf("%c", &achar);

}

uhmmm but what is wrong on these lines ? ...

thanks for reading my orrible english!

good night

GiGi