Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. // Temp.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3.  
  4. #include "pch.h"
  5. #include <iostream>
  6.  
  7. int main()
  8. {
  9.  
  10.     bool Backwards = true;
  11.     int ChildCount = 15;
  12.  
  13.     int CountStart = 0;
  14.     int TempTotal = 0;
  15.     int Direction = 1;
  16.  
  17.     if (Backwards)
  18.     {
  19.         TempTotal = ChildCount - 1;
  20.         CountStart = ChildCount - 1;
  21.         Direction = -1;
  22.     }
  23.  
  24.  
  25.     for (int i = CountStart; i != (ChildCount - TempTotal - 2); i += Direction)
  26.     {
  27.  
  28.  
  29.         std::cout << i << std::endl;
  30.  
  31.     }
  32.  
  33.     system("pause");
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement