解题思路:
注意事项:
参考代码:
Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int count=0; for (int i=0;i<s.length();i++){ int a = Integer.parseInt(String.valueOf(s.charAt(i))); if (a%2==1){ count++; } } System.out.println(count);
0.0分
0 人评分
字符串输入输出函数 (Java代码)浏览:1440 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:554 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:640 |
1014题解浏览:485 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:489 |
C二级辅导-阶乘数列 (C语言代码)浏览:521 |
陶陶摘苹果2 (C语言代码)浏览:601 |
生日日数 (C语言代码)浏览:1502 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:698 |
A+B for Input-Output Practice (C语言代码)浏览:471 |