๐จ๐ป Web Development/Java
[Day5] Java 5 - switch๋ฌธ, Random class
[Day5] Java 5 [8/12] 1. switch๋ฌธ int n,m; Scanner scanner = new Scanner( System.in); System.out.print("> ์ ์(n) ์
๋ ฅ ? "); n = scanner.nextInt(); m = scanner.nextInt(); System.out.printf("%d, %d \n", n , m); String result = ""; switch ( n % 2 ) { // key case 0: // value result ="์ง์(even number)"; break; default: result ="ํ์(odd number)"; break; } // switch System.out.printf("%d ์(๋) %s \n", n , resu..
2022. 8. 28. 18:08
์ต๊ทผ๋๊ธ