题解 | #字符个数统计#
字符个数统计
http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
import java.util.*; //JAVA //利用hashset去重,最后读取set的长度。 public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ Set outputSet = new HashSet(); String inputStr = sc.nextLine(); for(int i = 0; i<inputStr.length();i++){ outputSet.add(inputStr.charAt(i)); } System.out.println(outputSet.size()); } } }