C++ primer plus第六版课后编程练习答案:6.1

#define  _CRT_SECURE_NO_WARNINGS 
#include 
#include
using namespace std;

int main()
{
    char ch;

    cout << "Enter something(@ to quit):\n";
    while ((ch = cin.get()) !='@')
    {
        if (isupper(ch))
        {
            ch = tolower(ch);
            cout << ch;
        }
        else if (islower(ch))
        {
            ch = toupper(ch);
            cout << ch;
        }
        else
            cout << ch;
    }
    return 0;
}

你可能感兴趣的:(C++,primer,plus第六版课后编程练习)