请允许我说,我有一个方案,将信函转换成号码,以便:
投入:b
产出:1234
- How can I convert abcd to 1234 efficiently
- and how can I extract every individual char from the token
这样,这不是家务劳动。 (fun)
这是我迄今为止所做的事情:
public class Test {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new FileReader("test.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("test.out.txt")));
StringTokenizer st = new StringTokenizer(f.readLine());
int i1 = Integer.parseInt(st.nextToken());
// How can I convert this into integers? (where a = 1, b = 2, and c = 3)
out.println(????);
out.close();
System.exit(0);
}
}