问题详情

请完成下列Java程序:对大写的26个英文字母加密,从键盘输入一个大写字母串,输出这个串加密后的结果。加密操作是将字母变换成倒序的大写字母,如A->Z,B->Y。

注意:请勿改动main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。

程序运行结果如下:

输入一个大写字母串:ADFSDFFE

加密后的大写字母串:ZWUHWUUV

import java.io.*;

public class ex12_2{

public static void main (String[] args){

char ch = 'A';

String str;

System. out .print ( "输入一个大写字母串: ");

try{

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

str= in.readLine();

System. out .print ( "加密后的大写字母串:");

for(int i=0;i<str.length();i++){

_______________;

_______________;

System.out.print(ch);

}

}catch(IOException e){}

try{

System.in.read();

}catch(IOException e) {};

}

}

相关热点: 大写字母  

未搜索到的试题可在搜索页快速提交,您可在会员中心"提交的题"快速查看答案。 收藏该题
查看答案

相关问题推荐

联系我们 用户中心
返回顶部