M
Matt
If we have input Joe 25 in command line, then we are able to parse it
by following code:
Scanner s = new Scanner(System.in);
String name = s.next();
String age = s.nextInt();
s.close();
However, what if the input is 10:25:33? Are we able to parse it like
sscanf in C? Like the following C code?
char* buf = "10:25:33";
sscanf(buf, "%d:%d:%d", &h, &m, &s);
Please advise. thanks!!
by following code:
Scanner s = new Scanner(System.in);
String name = s.next();
String age = s.nextInt();
s.close();
However, what if the input is 10:25:33? Are we able to parse it like
sscanf in C? Like the following C code?
char* buf = "10:25:33";
sscanf(buf, "%d:%d:%d", &h, &m, &s);
Please advise. thanks!!