• + 0 comments

    con anyone fix my c++ solution please

    string solve(int n) {
        int x = 0;
        int pl =0;
        for(int i = 1; i<n/2+1;i++){
            if(n%i==0){
                x++;
                if(i%2==0){
                    if(sqrt(i) == (int)sqrt(i)){
                        pl++;
                    }
                }
            }
        }
        if(pl == 0){
            return to_string(0);
        }
        return (to_string(pl)+"/"+to_string(x));
    }