编CheckReverse.java,判断从命令行输入的参数字符串是否正读与反读一样的回文要用String类和StringBufBuf

[复制链接]
查看11 | 回复2 | 2010-11-4 09:40:40 | 显示全部楼层 |阅读模式
public static String InversePurchase(String a){//生成一个与a逆序的字符串int length=a.length();char[] ch=new char[length];for(int j=0,i=length-1;i=0;i--,j++){ch[j]=a.charAt(i);}return new String(ch);}public static void main(String args[]) {String temp1=null;String temp2=null;temp1=JOptionPane.showInputDialog("请输入一个
回复

使用道具 举报

千问 | 2010-11-4 09:40:40 | 显示全部楼层
public class CheckReverse { public static void main(String args[])
{
if (args.length==0) System.err.println("too few Args!");
else if (bg(args[0])) Syste
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行