标签:
package lovo.Linyoujia;
import java.util.Scanner;
public class Java {
@param args
public static void main(String[] args) {
TODO Auto-generated method stub
String bs = "asdfjvjadsffvaadfkfasaffdsasdffadsafafsafdadsfaafd";
int count = 0;
char[] charArray = bs.toCharArray();
for (int i = 0; i < bs.length() - 1; i++) {
if (charArray[i] == ‘a‘ && charArray[i + 1] == ‘f‘) {
count++;
}
}
System.out.println(count);
输入任意一个字符串,如:“abDEe23dJfd343dPOddfe4CdD5ccv!23rr”。取出该字符串中所有的字母。顺序不能改变!并把大写字母变成小写,小写字母变成大写!
标签:
原文地址:http://www.cnblogs.com/RunawayMama/p/5560867.html