Sinux1

PS5Q6 cs 111

Mar 11th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     for (int x = 99; x > 0; x -= 1)
  7.     {
  8.         if (x > 1)
  9.         {
  10.             cout << x << " bottles of Pepsi on the wall, ";
  11.             cout << x << " bottles of Pepsi.\n";
  12.             cout << "Take one down, pass it around, ";
  13.  
  14.             if (x == 2)
  15.             {
  16.                 cout << x-1 << " bottle of Pepsi on the wall.\n";
  17.             }
  18.             else
  19.             {
  20.                 cout << x-1 << " bottles of Pepsi on the wall.\n";
  21.             }
  22.         }
  23.         else
  24.         {
  25.             cout << x << " bottle of Pepsi on the wall, ";
  26.             cout << x << " bottle of Pepsi.\n";
  27.             cout << "Take one down, pass it around, ";
  28.             cout << x-1 << " bottles of Pepsi on the wall.\n";
  29.  
  30.         }
  31.     }
  32.  
  33.  
  34.  
  35.  
  36.     return 0;
  37. }
Add Comment
Please, Sign In to add comment