您的位置:首页 > 编程语言 > Java开发

HDU 5237 Base64 (Java大法好)

2015-08-09 17:00 330 查看
~!#~#@~!@~~~

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

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int casee = 0;
int t = sc.nextInt();
while (t > 0) {
t--;
casee++;
int k = sc.nextInt();
String str = sc.next();
byte tt[] = str.getBytes(); //转成byte型
for (int i = 0; i < k; ++i) {
tt = Base64.getEncoder().encode(tt); //加密
//Base64.getDecoder().decode(tt); //解密
}                      //coder 编码器
System.out.println("Case #" + casee + ": " + (new String(tt)));
//输出要转回来
}

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: