公式

B - qwerty 解説 by en_translator


The \(i\)-th Latin alphabet in the lexicographically order can be obtained as

(char)('a'+i-1)

in C++. Prepare an empty string, append one character by one and finally output it. A sample code in C++ follows.

Sample code (C++)

#include <bits/stdc++.h>
using namespace std;

int main(){
    string ans;
    for(int i = 0; i < 26; i++){
        int p; cin >> p; p--;
        ans += (char)('a'+p);
    }
    cout << ans << endl;
}

投稿日時:
最終更新: