java编程 :StringBuffer sb[]=new StringBuffer(input1);这里怎么出错了
packagea72;importjava.io.*;publicclassa72{publicstaticvoidmain(String[]args){Buffered...
package a72;
import java.io.*;
public class a72 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("输入准考证号码:");
int i;
int l[]=new int[16];
String input1=br.readLine();
l[i]=input1.length();
if(l[i]!=15){
System.out.println("输入错误!准考证号必须15位");
}
if((input1.endsWith("1"))||(input1.endsWith("3"))||(input1.endsWith("5"))||(input1.endsWith("7"))||(input1.endsWith("9")))
System.out.println("考试类别A类");
else System.out.println("考试类别B类");
StringBuffer sb[]=new StringBuffer(input1);
//
sb[i].replace(5,l[i]-4,"******"); //
System.out.println(sb[i]);
}
} 展开
import java.io.*;
public class a72 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("输入准考证号码:");
int i;
int l[]=new int[16];
String input1=br.readLine();
l[i]=input1.length();
if(l[i]!=15){
System.out.println("输入错误!准考证号必须15位");
}
if((input1.endsWith("1"))||(input1.endsWith("3"))||(input1.endsWith("5"))||(input1.endsWith("7"))||(input1.endsWith("9")))
System.out.println("考试类别A类");
else System.out.println("考试类别B类");
StringBuffer sb[]=new StringBuffer(input1);
//
sb[i].replace(5,l[i]-4,"******"); //
System.out.println(sb[i]);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询