Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- for (int x = 99; x > 0; x -= 1)
- {
- if (x > 1)
- {
- cout << x << " bottles of Pepsi on the wall, ";
- cout << x << " bottles of Pepsi.\n";
- cout << "Take one down, pass it around, ";
- if (x == 2)
- {
- cout << x-1 << " bottle of Pepsi on the wall.\n";
- }
- else
- {
- cout << x-1 << " bottles of Pepsi on the wall.\n";
- }
- }
- else
- {
- cout << x << " bottle of Pepsi on the wall, ";
- cout << x << " bottle of Pepsi.\n";
- cout << "Take one down, pass it around, ";
- cout << x-1 << " bottles of Pepsi on the wall.\n";
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment