# 改写字符串

键盘录入一个字符串，将字符串中的大写改成小写，小写改成大写，数字改成*。例如heLLO123,输出后为HEllo***

## template

```java
import java.util.Scanner;
public class Transfer {
	public static void main(String[] args) {
	String str = "";
	Scanner s = new Scanner(System.in);
	System.out.println("请输入您想输入的字符串：");
	str = s.next();
	StringBuffer sb = new StringBuffer();
	int i;
	for (i = 0; i <= str.length() - 1; i++) {
		char ch;
		if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z') {
			ch = (char) (str.charAt(i) - 32); 
		} else if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
			ch = (char) (str.charAt(i) + 32); 
		} else if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
			ch = '*'; 
		} else {
			ch = str.charAt(i); 
		}
		sb.append(ch); 
	}
	String trStr = sb.toString(); 
	System.out.println(sb.toString());
  }
}
```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```