1
2 #include <BinaryTree.h>
3 #include <iostream>
4 #include <cassert>
5
6 void main(int argc, char** argv) {
7 assert(argc==3);
8 const std::string binaryTreeDescription = argv[1];
9 const std::string binaryString = argv[2];
10 assert(binaryString.find_first_not_of("01")==std::string::npos);
11 std::cout<<"Inputs:\n"<<binaryTreeDescription<<"\n"<<binaryString<<"\n";
12 const BinaryTree binaryTree(binaryTreeDescription);
13 assert(binaryTree.getDescription()==binaryTreeDescription);
14 std::cout<<"Message: \""<<binaryTree.decode(binaryString)<<"\"\n\n";
15 }