알고리즘

[알고리즘] 백준 11283 - 한글 2 (C++)

blueberrysoda 2024. 10. 14. 23:55

[문제 링크] : https://www.acmicpc.net/problem/11283

#include <iostream>
#include <string>
using namespace std;

int main(){
    string S;
    cin >> S;

    int N = ((S[0] & 255) - 234) * 4096 + ((S[1] & 255) - 176) * 64 + (S[2] & 255) - 127;
    
    cout << N << "\n";
    return 0;
}