编写一个程序,输出诗歌“ Ninety-nine Bottles of Beer on the Wall’,程序应该用英文而不是数字输出瓶子数:
Ninety-nine bottles of beer on the wall
Ninety-nine bottles of beer,
Take one down, pass It around,
Ninety-eight bottles of beer on the wall
……
One bottle of beer on the wall
One bottle of beer
Take one down, pass it around
Zero bottles of beer on the wall
程序不可使用99个不同的输出语句来完成该题目。
#include <iostream>
#include<algorithm>
#include<string>
#include<cctype>
using namespace std;
void poem(string number1,string number2);
string transf(int num);
int main(){
int i=99;
while(i>0){
string nbr1,nbr2;
nbr1 = transf(i);
nbr2 = transf(i-1);
i--;
poem(nbr1,nbr2);
}
return 0; // 结束主程序
}
void poem(string number1,string number2 )<