Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool nova(int a,int b)
- {
- int bin;
- int zeraa=0;
- int jedynkia=0;
- int zerab=0;
- int jedynkib=0;
- do
- {
- bin = a%2;
- a = a / 2;
- if (bin == 0)
- {
- zeraa += 1;
- }
- else
- {
- jedynkia += 1;
- }
- //printf("%d", bin);
- } while (a > 0);
- do
- {
- bin = b % 2;
- b = b / 2;
- if (bin == 0)
- {
- zerab += 1;
- }
- else
- {
- jedynkib += 1;
- }
- //printf("%d", bin1);
- } while (b > 0);
- if (jedynkia == jedynkib&&zeraa == zerab)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- void kolos1()
- {
- int a = 254;
- int b = 254;
- printf("%d",nova(a, b));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement