题解 | #字符个数统计#
字符个数统计
http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
基本都是字符串处理
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); if(in.hasNextLine()){ String line = in.nextLine(); int count = 0; ArrayList<String> list = new ArrayList<String>(); for(int i=0;i<line.length();i++){ String s = line.substring(i,i+1); if (!list.contains(s)) { list.add(s); } } System.out.println(list.size()); } } }