1. 程式人生 > >C++一個簡單的刪除句子中母音字元的程式

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"); }