문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PR4DKAG0DFAUq
문제의 저작권은 SW Expert Academy에 있습니다.
#include <iostream> using namespace std; char decoding(char temp) { if(temp >= 'A' & temp <= 'Z') { temp = temp - 'A'; } else if(temp >= 'a' & temp <= 'z') { temp = temp - 'a' + 26; } else if(temp >= '0' & temp <= '9') { temp = temp - '0' + 52; } else if(temp == '+') { temp = 62; } else { temp = 63; } return temp; } int main(void) { int T; cin >> T; for(int t_case=0; t_case<T; t_case++) { string input, output = ""; char temp; cin >> input; for(int i=0; i<input.length()/4; i++) { temp = decoding(input.at(i*4))*4 + decoding(input.at(i*4+1))/16; output += temp; temp = (decoding(input.at(i*4+1))%16)*16 + (decoding(input.at(i*4+2))/4); output += temp; temp = (decoding(input.at(i*4+2))%4)*64 + decoding(input.at(i*4+3)); output += temp; } cout << "#" << t_case+1 << " " << output << "\n"; } return 0; } | cs |
'C & C++ > SW Expert Academy' 카테고리의 다른 글
SWEA 1285 - 아름이의 돌 던지기 (0) | 2018.04.28 |
---|---|
SWEA 1288 - 새로운 불면증 치료법 (0) | 2018.04.28 |
SWEA 1940 - 가랏! RC카! (0) | 2018.04.28 |
SWEA 1945 - 간단한 소인수분해 (0) | 2018.04.28 |
SWEA 1946 - 간단한 압축 풀기 (0) | 2018.04.28 |