C++ primer plus 第六章 编程练习1
#include<iostream>
#include<cctype>
#include<string>
int main()
{
using namespace std;
char ch;
cout << "Read until meet @: \n";
while ((ch=cin.get())!=EOF)
{
if(ch == '@')
break;
else if (isupper(ch))
cout << char(tolower(ch));
else if(islower(ch))
cout <<char(toupper(ch));
else if(isdigit(ch))
continue;
else
cout << ch;
}
return 0;
}
京公网安备 11010502036488号