수 조작하기1

· Algorithm
언어_자바 프로그래머스_수 조작하기1 public class Control1 { public static void main(String[] args) { Test4 t = new Test4(); int n = 0; String control = "wsdawsdassw"; t.test4(n, control); } } class Test4{ public int test4(int n, String control) { for (char cmd : control.toCharArray()) { // 문자열을 char 배열로 변환 switch (cmd) { case 'w': n += 1; break; case 's': n -= 1; break; case 'd': n += 10; break; case 'a': n -=..
31daylee
'수 조작하기1' 태그의 글 목록