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

void main()
{
	int type;
	char str[8];
	char *out;
	int num;

	printf("Input: ");
	scanf("%d %s",&type,str);
	
	printf("Output: ");

	switch (type)
	{
		case 0: num = bin2dec(str); 
			printf("%d",num);
			break;
		case 1: out = dec2bin(atoi(str)); 
			printf("%s",out);
			free(out);
			break;
		case 2: num = moddec(atoi(str),5);
			printf("%d",num);
			break;
		case 3: num = dec2bcd(atoi(str));
			printf("%d",num);
			break;
	}
	
	printf("\n");
}
