新手求人帮忙调试一下,自己实在不知道哪里错了。。。
程序代码:
#include<iostream> #include<string> using namespace::std; string make_plural(size_t ctr, const string &word, const string &ending "s"){ return(ctr==1)?word:word+ending; } int main(){ cout<<"Singular versior"<<make_plural(1,"success","es")<< "\t\tplural version:" <<make_plural(0,"success","es")<<endl <<"Singular version:"<<make_plural(1,"failue") <<"\t\tplural version:" <<make_plural(0,"failuue")<<endl; return 0; }