do~while
Scanner sc = new Scanner(System.in);
do {
System.out.println("점수 입력.(0 ~ 100)");
int input = sc.nextInt();
} while (input < 0 || input > 100);
정처기 문제
https://roadtofree.tistory.com/entry/%EC%A0%95%EB%B3%B4%EC%B2%98%EB%A6%AC%EA%B8%B0%EC%82%AC-%EC%8B%A4%EA%B8%B0-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D-%EB%AC%B8%EC%A0%9C-Java-%EA%B8%B0%EC%B6%9C-%ED%92%80%EC%9D%B4-%EB%AA%A8%EC%9D%8C
public static Scanner add() {
Scanner sc = new Scanner(System.in);
return null;
}
public static Scanner add() {
Scanner sc = new Scanner(System.in);
return sc;
}
package dec11;
import java.util.Scanner;
public class Print {
public static void main(String[] args) {
System.out.println("");
System.out.print("");
System.out.print("여기까지가 print출력\r\n");
System.out.println("ln이 있는 것.");
String name = "홍길동";
System.out.printf("그는 %s입니다.\n",name);
System.out.printf("그의 나이는 %d입니다.\n", 35);
System.out.printf("그의 나이는 %.2f입니다.\n", 35.0);
System.out.printf("%d를 8진수로 변환하면 %o \n", 10, 10);
System.out.printf("%d를 16진수로 변환하면 %x \n", 15, 15);
double pi = 3.1415926535;
System.out.printf("pi는 %f%n", pi);
System.out.printf("pi는 %.10f%n", pi);
System.out.printf("%d %n", 5);
System.out.printf("%5d %n", 5);
System.out.printf("%05d %n", 1300);
System.out.printf("%s %n", name);
System.out.printf("%5s %n", name);
System.out.printf("%-5s %n", name);
name = "홍길동입니다.";
System.out.printf("글자수 : %d %n", name.length());
System.out.printf("%.5s %n", name);
System.out.printf("%6.5s %n", name);
Scanner ret = add();
byte one = 10;
int two = one;
byte three = (byte) two;
}
public static Scanner add() {
Scanner sc = new Scanner(System.in);
return sc;
}
}