import java.io.*;
public class Carddelete
{
public static void main(String[] args)throws IOException
{
StringBuffer yp=new StringBuffer("A234567890JQK");
System.out.println("Let's play now!!");
//注意其中的
0代表10
StringBuffer p=new StringBuffer("A234567890JQK");
System.out.println(p);
int deletenum=0;
while(deletenum<13)
{
char dec=p.charAt(9); //p字符串中
10号牌
int i;
int sign=0;
for(i=0;i<yp.length();i++)
if(yp.charAt(i)==dec)
{
sign=i;
yp.deleteCharAt(i);//删除
yp(原)字符串中的牌
break;
}
deletenum++;
if(deletenum==12)
break;
StringBuffer s=new StringBuffer(yp.substring(sign)); //新建字符串
s包含 yp串中未读过的
int len2=s.length(); //s 串的长度
int len1=yp.length(); //剩余
yp串的字符个数
int n=((10-len2)/len1)+1;
s.append(yp);
for(i=1;i<n;i++)
s.append(yp );
//扩展字符串
s
p=s;
}
System.out.println(yp);
}
}