Advertisement
Guest User

n0rb

a guest
Jun 9th, 2010
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1.   for (int i = 1; i <= 6; i++)
  2.   {
  3.     if (i != (i / 2) * 2)
  4.     {
  5.       int j = 0;
  6.       do
  7.       {
  8.         j++;
  9.         if (j <= i)
  10.         {
  11.           cout << j;
  12.           if (j < i)
  13.           {
  14.             cout << "-";
  15.           }
  16.         }
  17.       }
  18.       while (j <= i);
  19.       cout << "\x0d\x0a";
  20.     }
  21.     else
  22.     {
  23.       int j = i + 1;
  24.       do
  25.       {
  26.         j--;
  27.         if (j >= 1)
  28.         {
  29.           cout << j;
  30.           if (j > 1) cout << "-";
  31.         }
  32.       }
  33.       while (j >= 1);
  34.       cout << "\x0d\x0a";
  35.     }
  36.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement