C++一个简单的删除句子中元音字符的程序

#include <iostream>
using namespace std;
void main()
{
    char c;
    string str;
    while(c = getchar())
    {
        if(c == '\n')
        {
            break;
        }   
        if(c=='A'||c=='E'||c=='I'||c=='O'||c=='U'||c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
        {           
        }
        else
            str+=c;
    }
    cout<<str.c_str()<<endl;
    system("pause");
}
全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务