fork download
  1. int main()
  2. {
  3. const int DEPTH = 6;
  4. for (int i = 1; i <= DEPTH; ++i)
  5. for (int j = 1; j <= i; ++j)
  6. printf("%d%c", i%2?j:i-j+1, "-\n"[i == j]);
  7. }
  8.  
Success #stdin #stdout 0s 5440KB
stdin
Standard input is empty
stdout
1
2-1
1-2-3
4-3-2-1
1-2-3-4-5
6-5-4-3-2-1