#include "stdafx.h"
#include <stdio.h>

#include "t5.h"

#define IS2N(x) (((x)&(x-1))?0:1)

int t6(void)
{
	bool y;

	printf("IS2N(0) == %d\n", IS2N(0)); 
	printf("IS2N(1) == %d\n", IS2N(1)); 
	printf("IS2N(2) == %d\n", IS2N(2)); 
	printf("IS2N(3) == %d\n", IS2N(3)); 
	printf("IS2N(4) == %d\n", IS2N(4)); 
	printf("IS2N(5) == %d\n", IS2N(5)); 
	printf("IS2N(12222) == %d\n", IS2N(12222)); 
	printf("IS2N(124) == %d\n", IS2N(124)); 
	printf("IS2N(512) == %d\n", IS2N(512)); 

	return 0;
}
/*
IS2N(0) == 1
IS2N(1) == 1
IS2N(2) == 1
IS2N(3) == 0
IS2N(4) == 1
IS2N(5) == 0
IS2N(12222) == 0
IS2N(124) == 0
IS2N(512) == 1
Press any key to continue . . .
*/

 

相关文章:

  • 2022-12-23
  • 2021-06-18
  • 2021-09-05
  • 2022-01-30
  • 2022-02-02
  • 2022-12-23
  • 2021-05-20
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-12-18
  • 2021-11-18
相关资源
相似解决方案