#includeusing namespace std; const int LEN = 66; const int DEVIDE = 6; void devide(char arr[], int low, int high, int level); int main() { char ruler[LEN]; ruler[LEN - 1] = '\0'; ruler[0] = ruler[LEN - 2] = '|'; for(int i = 1; i < LEN - 2; i++) ruler[i] = ' '; int min = 0; int max = LEN - 2; cout << ruler << endl; for(int j = 1; j <= DEVIDE; j++) { devide(ruler, min, max, j); cout << ruler << endl; } return 0; } void devide(char arr[], int low, int high, int level) { if(level == 0) return; int middle = (low + high) / 2; arr[middle] = '|'; devide(arr, low, middle, level - 1); devide(arr, middle, high, level - 1); }