将整个句子作为字符串读入,如果某个字母前面是空格或标点符号话就说明他是首字母,将其变成大写输出就行了。变大写的方法是根据他的ASCII码进行判断和调整
先按 Caps Lock 再按你要按的字母 就会输出大写字母了 如果想变回来 就再按一次
#include
#include
using namespace std;
int main()
{
string str;
cin>>str;
toupper(str[0]);
cout<
if(!(isalpha(str[i])||isdigit(str[i]))
{
++i;
toupper(str[i]);
cout<
}
system("pause");
return 0;
}