package code4;
import java.util.Scanner;
public class str {
public static String StringChange(String s){
StringBuilder a=new StringBuilder();
int len=s.length();
char c;
for(int i=0;i<len;i++) {
c=s.charAt(i);
if(c>='a' && c<='z')
{c=(char)(c-32);}
else if(c>='A' && c<='Z')
{c=(char)(c+32);}
a.append(c);
}
return a.toString();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请要转换的英文字符串:");
Scanner input=new Scanner(System.in);
String s=input.next();
System.out.println("你输入内容是:"+s);
System.out.println("转换后字符串为");
System.out.println(StringChange(s));
}}