<Git> CondOper01.java
·
console.log("What ? " + Cord);/Java
package ch01_variable_operator; public class CondOper01 { public static void main(String[] args) { // 최대값 변수 이름 : max int x = 3 ,y = 8 , z = 4 ; int max = x >= y ? x : y ; max = y >= z ? y : z ; max = y >= (x + z) ? y : z ; System.out.println("최대 수 : " + max); } } cf ) Myjava/CondOper01.java at master · nolooker/Myjava (github.com)
<Git> CondOper.java
·
console.log("What ? " + Cord);/Java
package ch01_variable_operator; public class CondOper { public static void main(String[] args) { int x = 3, y = 8, z = 4 ; int max = x > y ? x : y ; max = max > z ? max : z ; System.out.println("최대 : " + max); // 최소 값은 ? int min = x z ? x : z) : (y > z ? y : z) ; System.out.println("최대 : " + max); min = x
<Git> ArithmeticOperator.java
·
console.log("What ? " + Cord);/Java
package ch01_variable_operator; public class ArithmeticOperator { public static void main(String[] args) { int TIME = 4000 ; int imsi = TIME ; // 원본 데이터 보존 int hour ; hour = imsi / 3600 ; imsi %= 3600 ; // 시(hour) 구한 다음 잔여 데이터 int minute = imsi / 60 ; imsi %= 60 ; // 분(minute) 구한 다음 잔여 데이터 int second = imsi ; // 나머지 모두를 초(second)에 할당 System.out.print(TIME + "초는 ") ; System.out.print(hour + " 시간,..
<Git> add2.java
·
console.log("What ? " + Cord);/Java
package ch01_variable_operator; public class Add2 { public static void main(String[] args) { int a, b, c, result ; a = 3 ; b = 4 ; c = 5 ; result = 2*a + 3*b - c ; System.out.println("a = " + a); System.out.println("b = " + b); System.out.println("c = " + c); System.out.println("result = " + result); } } cf) Myjava/Add2.java at master · nolooker/Myjava (github.com)