1.
从键盘循环录入录入一个字符串
输入"end"表示结束 ,将字符串中大写字母变成小写字母,小写字母变成大写字母,其它字符用"*"代替,并统计字母的个数
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String next = sc.nextLine();
System.out.println("请输入一个字符串:");
//end结尾时继续输入
while(!next.endsWith("end")) {
next = next + sc.nextLine();
}
System.out.println("你输入的字符串为:"+next);
//调用转换方法
getUpperLower(next);
}
public static void getUpperLower(String string) {
char[] ch = string.toCharArray();
int count = 0;
//大小写数字进行转换
for(int i = 0; i < ch.length; i++) {
if(ch[i]>'A' && ch