바보 같은 질문이지만 1 행을 입력하고 3 개의 변수로 나누기를 원합니다. 내가 뭘 입력하고 싶은지 시간 분 및 두 번째 "10시 30 분 40 초"입니다 그리고 나는 그것을 변수로 저장할 수 있습니다. A = 시간 B = 분 C = 초3 개의 변수에서 하나의 입력 나누기
공용 클래스 Bituka {
public static void main (String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Biek littlepig = new Biek();
String x = null;
String y = null;
String z = null;
System.out.println("Enter Time");
x = br.readLine();
y = br.readLine();
z = br.readLine();
int a = Integer.parseInt(x);
int b = Integer.parseInt(y);
int c = Integer.parseInt(z);
littlepig.setTime(a,b,c);
System.out.println(littlepig.toMilitary());
}
}는 당신이 입력 시간, 다음 문자열로 가져 가서
"it"을 세 변수로 나누십시오? "그것"은 무엇을 말하는가? 정확하게 세 변수로 나누고 싶습니까? – Houseman
@Houseman 내가 입력하고 싶은 것은 시간 10:30:40이고 b C 변수에 시간 분 및 초를 저장하려고합니다. – tinker101