Skip to content

Latest commit

 

History

History
17 lines (17 loc) · 315 Bytes

343.md

File metadata and controls

17 lines (17 loc) · 315 Bytes

小学奥数题

class Solution {
public:
    int integerBreak(int n) {
        int ans = 1;
        while(n > 6)
            ans*=3, n-=3;
        if(n == 6) ans*=9;
        if(n == 5) ans*=6;
        if(n == 4) ans*=4;
        if(n == 2) return 1;
        if(n == 3) return 2;
        return ans;
    }
};