import java.util.*;
import java.lang.*;
// ぼくのかんがえたあんごう
class Main {
List<Character> あんごうせっていりすと = new ArrayList<>();
for (char もじ : C.もじせっと.toCharArray()) あんごうせっていりすと.add(もじ);
StringBuilder ばっふぁ = new StringBuilder();
for (Character もじ
: あんごうせっていりすと
) ばっふぁ.
append(もじ
);
String あんごうせってい
= ばっふぁ.
toString();
C いんすたんす = new C(ばっふぁ.toString());
System.
out.
println("あんごうせってい:" + あんごうせってい
); System.
out.
println("ひらぶん :" + ひらぶん
);
String あんごうぶん
= いんすたんす.あんごうかする
(ひらぶん
);
System.
out.
println("あんごうぶん :" + あんごうぶん
);
String ふくごうぶん
= いんすたんす.ふくごうかする
(あんごうぶん
);
System.
out.
println("ふくごうぶん :" + ふくごうぶん
); }
private static class C {
public static final String もじせっと
= " 、。ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖー0123456789";
private final Map
<Character, Character
> あんごうかまっぷ
; private final Map
<Character, Character
> ふくごうかまっぷ
;
あんごうかまっぷ = new HashMap<>();
ふくごうかまっぷ = new HashMap<>();
for (int あい = 0; あい < もじせっと.length(); あい ++) {
あんごうかまっぷ.put(もじせっと.charAt(あい), あんごうせってい.charAt(あい));
ふくごうかまっぷ.put(あんごうせってい.charAt(あい), もじせっと.charAt(あい));
}
}
StringBuilder ばっふぁ = new StringBuilder();
for (char もじ : ひらぶん.toCharArray())
if (あんごうかまっぷ.containsKey(もじ)) ばっふぁ.append(あんごうかまっぷ.get(もじ));
else ばっふぁ.append(もじ);
return ばっふぁ.toString();
}
StringBuilder ばっふぁ = new StringBuilder();
for (char もじ : あんごうぶん.toCharArray())
if (ふくごうかまっぷ.containsKey(もじ)) ばっふぁ.append(ふくごうかまっぷ.get(もじ));
else ばっふぁ.append(もじ);
return ばっふぁ.toString();
}
}
}
aW1wb3J0IGphdmEudXRpbC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