#include <iostream> using namespace std; int main(){ \x09string next; \x09int depth = 0; \x09cin >> next; \x09for(int p = 0; p < next.length(); p++){ \x09\x09if(next.at(p) == 'f' || depth == 0){ \x09\x09\x09cout << '#'; \x09\x09\x09depth++; \x09\x09} \x09\x09else \x09\x09\x09cout << endl << string(depth - 1, '.') << '#'; \x09} \x09cout << endl; }
Note that non-ascii characters in the above source code will be escaped (such as \x9f).