适才去中软面试了

刚才去中软面试了!
本人非计算机专业。应届毕业生,,前几天刚毕业正在找工作,刚才上午去中软面试了,大家帮我参谋参谋。面试官问了我个问题,父类和子类的关系是啥,我说继承。说完感觉好像说太少了,然后就补充了,公有继承的时候,子类能使用父类的公有接口什么的。感觉还好,然后聊了聊其他方面的。。然后人让我纸上写代码!只在人家口中听过的事情在我身上发生了,有点紧张适才去中软面试了。在一个字符串中删除出现次数最多的字符。刚开始听着有点蒙,,我说让我想会儿。。过了半分钟看我没啥动静,,面试官说,如果觉得难的话写个冒泡排序吧,,,我当即就感觉情况不妙了啊适才去中软面试了。冒泡很快的写了出来,一遍写还一遍在想之前那个题怎么写,,,然后突然灵机一动想到方法了。。。先把字符串排序,然后遍历,统计每个相同字符出现的次数,记录每一组相同字符出现的第一字符的迭代器和具体字符,然后如果统计次数大于max,就一溜替换掉。突然就写出来了,虽然纸上写的很乱,,但是通过自己的说明,,算是让面试官理解了。。。但是我回家之后想了想,发现不对!因为排序把原来的字符串顺序改掉了,在冷静的情况,我自己又分析了下,,做了改进,并上机实地操作,并成功!
# include <iostream>
# include <string>
# include <algorithm>
using namespace std;

int main(void)
{
string s = "acabadddddd";
string t(s);
sort(s.begin(), s.end());
char tempc = '\0', maxc;
string::size_type count = 0, max = 0;
string::iterator tempit = s.begin(), maxit;
for (string::iterator it = s.begin(); it != s.end(); ++it)
{
if (*it != tempc)
{
if (count > max)
{
max = count;
maxit = tempit;
maxc = tempc;
}
count = 1;
tempit = it;
tempc = *it;
}
else
count++;
}
if (count > max)//最后一组迭代完之后需要在循环外判断
{
max = count;
maxit = tempit;
maxc = tempc;
}


s.erase(maxit, maxit + max);
string::iterator i = t.begin(), ti;
while ((ti = find(i, t.end(), maxc)) != t.end())
{
i = t.erase(ti);
}

cout << s << endl;
cout << t << endl;

return 0;
}

感觉自己还行啊-。-  虽然我深知自己水平依然很菜!好了,言归正传。问题来了,虽然面试官对我的表现觉得还可以!但是他说我不会数据库,不会linux,技能还有所欠缺,,所以我来此撒分了!求推荐学习linux和oracle的书籍。。。。。。。
------解决思路----------------------
apue。unix网络变成。tcp/ip协议
------解决思路----------------------
肯定会有人劝你不要去中软。
中软薪资水平不算高,而且多数岗位属于外包。
------解决思路----------------------
楼主好厉害。比我毕业时候厉害多了。
------解决思路----------------------
  尽量去互联网公司  不然你看到的就井口那么大
------解决思路----------------------
给我打了N次电话让我去给他们当.net和c++的项目经理,一说外包,我就拒了…………。是不是以后再也没机去去中软了?
------解决思路----------------------

    string s = "ffaaaaaaaaaaaccdffgaddfa";

    int _count = 0;
    char _cMax;
    for (int i = 0; i < s.size(); i++)
    {
        char c = s.at(i);

        int currentCount = 0;
        for (int j = 0; j < s.size(); j++)
        {
            char c2 = s.at(j);
            if (c2 == c)
            {
                currentCount++;
            }
        }
        if (currentCount > _count)
        {
            _count = currentCount;
            _cMax = c;
        }
    }

    string s2 = "";
    for (int i = 0; i < s.size(); i++)
    {
        char c = s.at(i);

        if (c != _cMax)
        {
            s2.push_back(c);
        }
    }
    s = s2;



Linux: 《鸟哥的Linux私房菜》,《Linux程序设计》(里面有MySQL+C实例)

寡看书没用的,装个CentOS操练起来吧!
------解决思路----------------------
没有人一毕业什么都会的,而且不建议去外包,网上的评价总体来说不好。学习linux的话,unix环境高级编程,里面讲最基础的API,使用的话,你虚拟机里面安装个CentOS就可以开始学习了。另外,看到你的题目,用了排序,其实完全不需要排序的哦。


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main ()
{
    const char *input = "acabadddddd";

    char *out;
    const unsigned char *ptr = input;
    int table[256] = {0}, max = 0, i;
    
    while (*ptr) {
        table[*ptr++]++;
    }

    for (i = 1; i < 256; ++i) {
        if (table[max] < table[i])
            max = i;
    }

    out = malloc (ptr - input - table[max] + 1);

    for (i = 0, ptr = input; *ptr; ++ptr) {
        if (*ptr != max) {
            out[i++] = *ptr;
        }
    }
    out[i] = '\0';

    printf ("%s\n%s\n", input, out);

    free (out);

    return 0;
}

------解决思路----------------------
中软的待遇和二线城市一个价
------解决思路----------------------
鸟哥的私房菜 
------解决思路----------------------
非计算机专业算是中途出家了,如果真想当程序员的话,刚开始要做好从小公司做起的准备,毕竟跟计算机专业的比起来怎么都要差上一截的,虽然本科教育就那样,但是也不乏高手
------解决思路----------------------
you are just a freshman for the company ,So don't  worried, taks easy!
------解决思路----------------------
个人觉得可以先去,接触的知识也比较广,攒点经验,再去自主研发的公司
------解决思路----------------------
用map试试
map<char,int> cnt;
    string s = "ffaaaaaaaaaaaccdffgaddfa";
    int ctmax=0,maxchar;
    for(char &ch : s) {
        int &t =cnt[ch];
        if(++t>ctmax){
            ctmax =t;
            maxchar =ch;
        }
    }
    s.erase(remove(s.begin(),s.end(),maxchar),s.end());

------解决思路----------------------

#include <iostream>
#include <string>
#include <cstring>

char fuck(const std::string &str)
{
    int buf[128];
    memset(buf , 0 , sizeof(buf));
    for(auto const &ch : str)
    {
        buf[ch]++;
    }

    int max = buf[0];
    char ch;
    for(size_t i = 0 ; i < sizeof(buf) / sizeof(int) ; ++i)
    {
        if(buf[i] > max)
        {
            max = buf[i];
            ch = i;
        }
    }

    return ch;
}

std::string& bitch(std::string &str , char ch)
{
    for(auto it = str.begin() ; it != str.end() ; )
    {
        if(*it == ch)
        {
            it = str.erase(it);
        }
        else
        {
            ++it;
        }
    }

    return str;
}

int main(void)
{
    //空格最多,会被删除
    std::string str = "hello **** , you are a fucking website";
    auto ch = fuck(str);
    bitch(str , ch);
    std::cout << str << std::endl;

    return 0;
}