网易2019游戏研发工程师笔试题

第一题:计算个人所得税

#include 
using namespace std;
int main(){
    int t,n,result;
    float tmp;
    const float g=0.5000001;
    while(cin>>t){
        for(auto i=0;i>n;
            if(n<=5000) {
                cout << 0 << endl;
                continue;
            }
            n-=5000;
            tmp=0;
            if(n<3000){
                tmp=n*0.03;
            }else if(n<=12000){
                tmp=90+(n-3000)*0.1;
            } else if(n<=25000){
                tmp=990+(n-12000)*0.2;
            } else if(n<=35000){
                tmp=990+2600+(n-25000)*0.25;
            } else if(n<=55000){
                tmp=990+2600+2500+(n-35000)*0.3;
            } else if(n<=80000){
                tmp=990+2500+2600+6000+(n-55000)*0.35;
            } else {
                tmp=990+2500+2600+6000+8750+(n-80000)*0.45;
            }
            result=tmp+g;
            cout<

第二题:密码强度判断

#include 
#include 
#include 

using namespace std;
string test[6]={"password","admin","qwerty","hello","iloveyou","112233"};
inline bool isA(char& c){
    if(c>'Z'||c<'A'){
        return false;
    } else {
        return true;
    }
}
inline bool isa(char& c){
    if(c>'z'||c<'a'){
        return false;
    } else {
        return true;
    }
}
inline bool isNumber(char& c){
    if(c>'9'||c<'0')
        return false;
    else
        return true;
}

inline bool isSp(char & c){
    int t=c;
    if(c==33||(c>34&&c<39)||(c>39&&c<48)||(c>59&&c<65)||c==91||(c>92&&c<96)||c==123||c==125){
        return  true;
    } else
        return false;
}

bool checkAll(string& str){
    auto len=str.size();
    bool A= false,a= false,n= false,sp= false;
    for(auto i=0;i>m){
        vector v(m);
        for(auto i=0;i>str;

            if(solve(str))
                v[i]="yes";
            else
                v[i]="no";
        }
        for(auto i=0;i

刚写到第二题就接到腾讯互娱的面试电话,接完电话笔试还剩22分钟。凉凉...

你可能感兴趣的:(C++,算法)