Created
August 7, 2015 02:45
-
-
Save ParkMinKyu/a3c48d42d45d12bea339 to your computer and use it in GitHub Desktop.
계산기 완성본
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class 계산기{ | |
//값두개를 받는다.(int a, int b) | |
void 덧셈(int a, int b){ | |
int c = a + b; | |
System.out.println("a+b=" + c); | |
} | |
void 빼기(int a, int b){ | |
//값을 두개 받는다. | |
//뺀다 | |
//값을 출력한다. | |
int c = a - b; | |
System.out.println("a-b=" + c); | |
} | |
void 곱하기(int a, int b){ | |
//값을 두개 받는다. | |
//곱한다. | |
//값을 출력한다. | |
int c = a * b; | |
System.out.println("a*b=" + c); | |
} | |
void 나누기(int a, int b){ | |
//값을 두개 받는다. | |
//나눈다 | |
//값을 출력한다. | |
int c = a / b; | |
System.out.println("a/b=" + c); | |
} | |
public static void main(String args[]){ | |
계산기 c = new 계산기(); | |
System.out.println("하이"); | |
c.덧셈(1,4); | |
c.빼기(1,4); | |
c.곱하기(1,4); | |
c.나누기(1,4); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment