C++编译出错 error C2143:error C2059:
代码如下:#include<iostream>#include<string>usingnamespacestd;stringmake_plur(size_tctr,co...
代码如下:
#include <iostream>
#include <string>
using namespace std;
string make_plur(size_t ctr, const string &word, const string &ending "s")
{
return (ctr==1)?word:word+ending;
}
int main()
{
cout<<"Singular version: "<<make_plur(1,"failure","s")<<"\t\tplural version: "
<<make_plur(0,"failure","s")<<endl;
return 0;
} 展开
#include <iostream>
#include <string>
using namespace std;
string make_plur(size_t ctr, const string &word, const string &ending "s")
{
return (ctr==1)?word:word+ending;
}
int main()
{
cout<<"Singular version: "<<make_plur(1,"failure","s")<<"\t\tplural version: "
<<make_plur(0,"failure","s")<<endl;
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询