码迷,mamicode.com
首页 > 其他好文 > 详细

codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)

时间:2016-07-20 19:11:58      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

题目链接:http://www.codeforces.com/problemset/problem/118/A
题意:字符串转换……
C++代码:

技术分享
#include <string>
#include <iostream>
using namespace std;
string s;
bool _in(char c, string s)
{
    for (int i =0 ; i < s.length(); i ++)
        if (c == s[i])
            return true;
    return false;
}
int main()
{
    cin >> s;
    int len = s.length();
    for (int i = 0; i < len; i ++)
    {
        char c = s[i];
        if (c >= A && c <= Z)
            c += 32;
        if (_in(c, "aeiouy"))
            ;
        else
            cout << "." << c;
    }
    return 0;
}
C++

 

codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)

标签:

原文地址:http://www.cnblogs.com/moonlightpoet/p/5689423.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!