解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner in = new Scanner(System.in); String str = in.next(); char[] ch = str.toCharArray(); int count = 0; for (int i = 0; i < ch.length; i++) { if (ch[i]>='0'&&ch[i]<='9') { count++; } } System.out.println(count); } }
0.0分
0 人评分