c++第六章第一题

#include<iostream>
#include<cctype>
using namespace std;
int main()
{
    char ch; 
    cin.get(ch);
    while(ch != '@')
    {
        if(isdigit(ch))
            cin.get(ch);
        else
        {
            if(islower(ch))
                ch = toupper(ch);
            else
                ch = tolower(ch);
        cout << ch ;// 由于缓冲  那么应该的结束for 循环以后才能输出;
        cin.get(ch); 
        }
    }

    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_40860649/article/details/78608367