Code Hunt 제1장 산술편 답안

2142 단어
잔말 말고 바로 결과 를 보아라
01.01
public class Program {
    public static int Puzzle(int x) {
        return 0-x;
    }
}

01.02
public class Program {
    public static int Puzzle(int x) {
        return x-2;
    }
}

01.03
public class Program {
    public static int Puzzle(int x) {
        return x*x;
    }
}
01.04
public class Program {
    public static int Puzzle(int x) {
        return 3*x;
    }
}

01.05
public class Program {
    public static int Puzzle(int x) {
        return x/3;
    }
}

01.06
public class Program {
    public static int Puzzle(int x) {
        return 4/x;
    }
}

01.07
public class Program {
    public static int Puzzle(int x, int y) {
        return x-y;
    }
}

01.08
public class Program {
    public static int Puzzle(int x, int y) { 
        return x+2*y;
    }
}
01.09
public class Program {
    public static int Puzzle(int x, int y) {
        return x*y;
    }
}

01.10
public class Program {
    public static int Puzzle(int x, int y) {
        return (3 * x + y) / 3;
    }
}

01.11
public class Program {
    public static int Puzzle(int x, int y) { 
        return x/y;
    }
}

01.12
public class Program {
    public static int Puzzle(int x) {
        return x%3;
    }
}

01.13
public class Program {
    public static int Puzzle(int x) {
        return x%3+1;
    }
}

01.14
public class Program {
    public static int Puzzle(int x) {
        return 10%x;
    }
}

01.15
public class Program {
    public static int Puzzle(int x, int y, int z) {
        return (x + y + z)/3;
    }
}

좋은 웹페이지 즐겨찾기