알고리즘/SWEA

[SWEA] 1928. Base64 Decoder

Ellie67 2022. 11. 7. 16:03

 

https://swexpertacademy.com/main/main.do

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

SWEA 1928번

 

인코딩 

Base64.getEncoder().encodeToString(원문)

디코딩

Base64.getDecoder().decode(인코딩된 스트링)

 

import java.util.Base64;
import java.util.Scanner;

public class P1928 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int t=1; t<=T; t++){
            String str = sc.next();
            String ans = new String(Base64.getDecoder().decode(str));
            System.out.println("#"+t+" "+ans);
        }
    }
}