118A - String Task

2018-01-11  本文已影响0人  社交帐号直接注册
#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    char a[101];
    int i, length;
    cin >> a;
    length = strlen(a);
    for (i = 0; i < length; i++)
    {
        if (a[i] == 'a' || a[i] == 'A' || a[i] == 'o' || a[i] == 'O'
            || a[i] == 'y' || a[i] == 'Y' || a[i] == 'e' || a[i] == 'E' ||
            a[i] == 'u' || a[i] == 'U' || a[i] == 'i' || a[i] == 'I')
        {
            continue;
        }
        else
        {
            if (a[i] >= 'A'&&a[i] <= 'Z')
            {
                a[i] = a[i] + 32;
            }
            cout << "." << a[i];
        }
    }
    cout << endl;

    system("pause");
}
上一篇 下一篇

猜你喜欢

热点阅读