Reputation: 83
how would you code this in Java?
char c;
int n;
cin >> c >> n;
So that I can get this kind of inputs:
X123123
Upvotes: 8
Views: 52168
Reputation: 284796
You can use Scanner
with System.in
. E.g.
Scanner s = new Scanner(System.in);
char c = s.findInLine(".").charAt(0);
int n = s.nextInt();
Upvotes: 22