zoukankan      html  css  js  c++  java
  • poj1566

    简单题

    View Code
    //zoj1713
    #include <iostream>
    #include <string>
    using namespace std;
    
    string    st;
    
    bool syll(char a)
    {
        if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y')
            return true;
        return false;
    }
    
    bool judge(string a, int num)
    {
        int        i, l = a.length(), temp = 0;
    
        
        if (syll(a[0]))
            temp++;
        for (i = 1; i < l; i++)
            if (syll(a[i]) && !syll(a[i-1]))
                temp++;
        if (temp == num)
            return true;
        return false;
    }
    
    void work()
    {
        string    st1, st2, st3;
        int        t;
    
        t = st.find("/");
        st1 = st.substr(0, t);
        st.erase(0, t + 1);
        t = st.find("/");
        st2 = st.substr(0, t);
        st.erase(0, t + 1);
        st3 = st;
        if (!judge(st1, 5))
        {
            cout << "1" << endl;
            return;
        }
        if (!judge(st2, 7))
        {
            cout << "2" << endl;
            return;
        }
        if (!judge(st3, 5))
        {
            cout << "3" << endl;
            return;
        }
        cout << "Y" << endl;
    }
    
    int main()
    {
        //freopen("t.txt", "r", stdin);
        while (getline(cin, st) && st != "e/o/i")
            work();
        return 0;
    }
  • 相关阅读:
    Wireshark抓包分析TCP 3次握手、4次挥手过程
    Wireshark基本介绍和学习TCP三次握手
    关于TCP窗口大小
    stat
    Disk
    内存对齐
    Openssl asn1parse命令
    checkinstall
    Nginx
    Linux top
  • 原文地址:https://www.cnblogs.com/rainydays/p/2983218.html
Copyright © 2011-2022 走看看