Skip to content

Instantly share code, notes, and snippets.

@tmyt
Created December 11, 2010 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmyt/737330 to your computer and use it in GitHub Desktop.
Save tmyt/737330 to your computer and use it in GitHub Desktop.
Bubobo (require VisualC++)
#include<string>
#include<iostream>
#include<stack>
int main()
{
std::string s;
while(std::getline(std::cin, s))
{
for each(char c in s)
{
std::stack<int> stack;
unsigned char uc = c;
for(int i = 0; i < 8; ++i)
{
stack.push(uc & 1 );
uc >>= 1;
}
while(!stack.empty())
{
printf(stack.top() == 0 ? "ぶ" : "ぼ");
stack.pop();
}
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment