12. 条件查询2

创建日期:2024-07-14
更新日期:2025-02-01

ifelse.cpp

#include <iostream>

int main()
{
    char ch;
    std::cout << "Type, and I shall repeat.\n";
    std::cin.get(ch);
    while (ch != '.')
    {
        if (ch == '\n')
        {
            std::cout << ch;
        }
        else
        {
            std::cout << ++ch;
        }
        std::cin.get(ch);
    }
    std::cout << "\nPlease excuse the slight confusion.\n";
}