#include<iostream>
#include<fstream>
#include<cstdlib>//
#include<string>
#include<cctype>
using namespace std;
void strupper(string &s);
void strupper(string &s)
{
for(int i=0;i<s.size();i++)
s[i]=toupper(s[i]);
cout<<s<<endl;
}
void main()
{
string str;
cout<<"enter a string(q to quit):";
while(getline(cin,str))
{
if(str=="q")
break;
else
strupper(str);
cout<<"enter a string(q to quit):";
}
}
C++primer plus第六版课后编程练习答案8.3
最新推荐文章于 2022-09-29 10:38:30 发布