# 单词反转

随便输出一个字符串
String str ="45abc,+de==fg";
里面含有 abc，de，fg 三个单词
怎么处理能让单词反转，其他顺序不变呢
输出 “45cba,+ed==gf”;

## template

```java
public class HelloWorld {
	public static String revstr(String s) {
		char[] ch = s.toCharArray();
		for (int i = 0; i < ch.length; i++) {
			if ((ch[i] >= 'A' && ch[i] <= 'Z') || (ch[i] >= 'a' && ch[i] <= 'z')) {
				int j = i + 1;
				while (j < ch.length && ((ch[j] >= 'A' && ch[j] <= 'Z') || (ch[j] >= 'a' && ch[j] <= 'z')))
					j++;
				j--;
				if (i != j) {
					for (int k = i; k <= (j - i) / 2 + i; k++) {
						char temp = ch[k];
						ch[k] = ch[j - k + i];
						ch[j - k + i] = temp;
					}
				}
				i = j;
			}
		}
		return new String(ch);
	}
	public static void main(String[] args) {
		System.out.println(revstr("45abc,+de==fg"));
	}
}
```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```