#include <iostream>
#include <cctype>
using namespace std;
int main()
{
cout << "Enter text for analysis, and type @ to terminate input.\n";
char ch;
while(ch != '@')
{
if(islower(ch))
{
ch = toupper(ch);
}
else if(isupper(ch))
{
ch = tolower(ch);
}
if(isdigit(ch) == false)
{
cout << ch;
}
cin.get(ch);
}
cout << endl;
return 0;
}
编写一个程序,读取键盘输入,直到遇到@符号为止,并回显输入(数字除外),同时将大写字符转换为小写,将小写字符转换为大写(别忘了cctype函数系列)
最新推荐文章于 2024-07-11 05:15:00 发布