fork download
  1. #include <iostream>
  2. int main() {
  3. char f[] = "0112358532110";
  4. char * pf1 = f+6;
  5. char * pf2 = pf1;
  6.  
  7. for(int i=6; i>-1;--i){
  8. std::cout << std::string(i, '-') << std::string(pf1--, ++pf2) << '\n';
  9. }
  10. ++pf1;
  11. for(int i=1; i<7;++i){
  12. std::cout << std::string(i, '-') << std::string(++pf1, --pf2) << '\n';
  13. }
  14.  
  15. }
Success #stdin #stdout 0.01s 5544KB
stdin
Standard input is empty
stdout
------8
-----585
----35853
---2358532
--123585321
-11235853211
0112358532110
-11235853211
--123585321
---2358532
----35853
-----585
------8