zoukankan      html  css  js  c++  java
  • 含e最多的单词


    #include <iostream>
    #include <cstdio>
    #include <cstring>
    #include <vector>
    using namespace std;
    int ce(string str)
    {
        int count = 0;
        for (int i = 0; i < str.length(); i++)
        {
            if (str[i] == 'e')
                count++;
        }
        //cout << count << endl;计算e的个数
        return count;
    }
    int main()
    {
        int maxe = 0;
        string maxstr;
        string str;
        cin >> str;
        string ss[25];
        int s = 0;
        while (str != "#")
        {
            if (ce(str) > maxe)
            {
                maxe=ce(str);
                s = 0;
                ss[s++] = str;
                //cout<<"new"<<endl;
            }
            else if (ce(str) == maxe)
            {
                ss[s++] = str;ji
                
                //cout<<'='<<endl;
            }
            cin >> str;
        }
        for (int i = 0; i < s; i++)
            cout << ss[i] << endl;
        return 0;
    }

  • 相关阅读:
    Spring Boot的每个模块包详解
    spring框架所有包说明
    TCP三次握手和四次挥手
    线程池实现原理
    AVL树与红黑树
    去哪儿网面经
    什么是缓存一致性问题?如何解决?
    Redis的应用场景和优缺点
    线程池
    手写快排
  • 原文地址:https://www.cnblogs.com/kubopiy/p/14994886.html
Copyright © 2011-2022 走看看