#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <cmath>
using namespace std;

int main(void)
{
    char* input = "01001001001000000110110001101001011010110110010100100000011110010110111101110101";
	int length = strlen(input);     //get length of string
	
	int binary[8];    //array used to store 1 byte of binary number (1 character)
	int asciiNum = 0;      //the ascii number after conversion from binary
	char ascii;      //the ascii character itself
	
	cout << " ";
	
	int z = 0;   //counter used
	
	for(int x = 0; x < length / 8; x++)     //reading in bytes. total characters = length / 8
	{
		for(int a = 0; a < 8; a++)      //store info into binary[0] through binary[7]
		{
			binary[a] = (int) input[z] - 48;      //z never resets
			z++;
		}
		
		int power[8];    //will set powers of 2 in an array
		int counter = 7;        //power starts at 2^0, ends at 2^7
		for(int x = 0; x < 8; x++)
		{
			power[x] = counter;      //power[] = {7, 6, 5, ..... 1, 0}
			counter--;    //decrement counter each time
		}
		
		for(int y = 0; y < 8; y++)    //will compute asciiNum
		{
			double a = binary[y];    //store the element from binary[] as "a"
			double b = power[y];    //store the lement from power[] as "b"
			
			asciiNum += a* pow(2, b);   //asciiNum = sum of a * 2^power where 0 <= power <= 7, power is int
		}
		
		ascii = asciiNum;   //assign the asciiNum value to ascii, to change it into an actual character
		asciiNum = 0;    //reset asciiNum for next loop
		
		cout << ascii;	//display the ascii character
	}

	
	return 0;
}
