fork(1) download
  1. #include <iostream>
  2. #include <map>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. wchar_t str[] = L"おえいうあ";
  8. map<wchar_t, int> charactor_to_handle = {
  9. { L'あ', 0 },
  10. { L'い', 1 },
  11. { L'う', 2 },
  12. { L'え', 3 },
  13. { L'お', 4 },
  14. };
  15. int n[256] = { 100, 200, 300, 400, 500 };
  16.  
  17. for(int i = 0; i < wcslen(str); ++i) {
  18. wcout << n[charactor_to_handle[str[i]]] << endl;
  19. }
  20.  
  21. cin.get();
  22. return 0;
  23. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
500
400
200
300
100