7-119 4002 按错键

打表King何意味,,

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using i32 = std::int32_t;
using i64 = std::int64_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;
using pii = std::pair<i32, i32>;
using pll = std::pair<i64, i64>;
using vi = std::vector<i32>;
using vll = std::vector<i64>;
using vpii = std::vector<pii>;
using vpll = std::vector<pll>;

void solve();

int main()
{
    std::cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}

void solve()
{
    std::unordered_map<char, char> map{
        {'1', '`'}, {'2', '1'}, {'3', '2'}, {'4', '3'}, {'5', '4'}, {'6', '5'},  {'7', '6'},  {'8', '7'}, {'9', '8'},
        {'0', '9'}, {'-', '0'}, {'=', '-'}, {'W', 'Q'}, {'E', 'W'}, {'R', 'E'},  {'T', 'R'},  {'Y', 'T'}, {'U', 'Y'},
        {'I', 'U'}, {'O', 'I'}, {'P', 'O'}, {'[', 'P'}, {']', '['}, {'\\', ']'}, {'S', 'A'},  {'D', 'S'}, {'F', 'D'},
        {'G', 'F'}, {'H', 'G'}, {'J', 'H'}, {'K', 'J'}, {'L', 'K'}, {';', 'L'},  {'\'', ';'}, {'X', 'Z'}, {'C', 'X'},
        {'V', 'C'}, {'B', 'V'}, {'N', 'B'}, {'M', 'N'}, {',', 'M'}, {'.', ','},  {'/', '.'},  {' ', ' '}};
    std::string str;
    bool endl = false;
    while (std::getline(std::cin, str))
    {
        if (endl)
        {
            std::cout << '\n';
        }
        for (auto &item : str)
        {
            std::cout << map[item];
        }
        endl = true;
    }
}
posted @ 2025-10-13 23:33  TPPPP72  阅读(6)  评论(0)    收藏  举报