#include <stdio.h>
#include <stdint.h>
uint8_t i=0;		// 0			1			3			7			15
uint8_t mass[10] = {0b00000000, 0b00000001, 0b00000011, 0b00000111, 0b00001111,
//			31			63			127			255			255
		0b00011111, 0b00111111, 0b01111111, 0b11111101, 0b10111111
};
uint8_t reverse (uint8_t d)
{
	uint8_t a, b;
	static const uint8_t revTable[] = {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15};
	a = d >> 4;
	a = revTable[a];
	b = d & 0x0F;
	b = (revTable[b])<<4;
	
	return (b | a);
}
int main(void) {
	// your code goes here
	for(i=0; i<(sizeof(mass)/2); i++){
		uint8_t q = mass[i];
		mass[i] = mass[sizeof(mass)-1-i];
		mass[sizeof(mass)-1-i] = q;
	}
	for(i=0; i<10; i++){
		mass[i] = reverse (mass[i]);
	}
 
 
	for(i=0; i<10; i++){
		printf("%d", mass[i]);
		printf(",");
	}
	return 0;
}
