Introduction to Java Programming编程题9.15<求字符串中大写字母的个数>
来源:互联网 发布:linux vm commit over 编辑:程序博客网 时间:2024/06/02 16:28
/*java CountUpperCase RollingInTheDeepThe uppercase total is: 4java CountUpperCase Rolling In The Deep Adele Steven Sharp Nelson Jon Schmidt.The uppercase total is: 10 */public class CountUpperCase { public static void main(String[] args) { int totalUpperCase = 0, i = 0; while (i < args.length) { totalUpperCase += countUpperCase(args[i]); i++; } System.out.println("The uppercase total is: " + totalUpperCase); } public static int countUpperCase(String s) { int totalUpperCase = 0; for (int i = 0; i < s.length(); i++) { if (Character.isUpperCase(s.charAt(i))) totalUpperCase++; } return totalUpperCase; }}
0 0
- Introduction to Java Programming编程题9.15<求字符串中大写字母的个数>
- Introduction to Java Programming编程题9.6<统计字符串中字母的个数>
- Introduction to Java Programming编程题9.5<统计字符串中数字的个数>
- Introduction to Java Programming编程题9.14<求字符串中整数的和>
- 求一个字符串中大写字母的个数
- Introduction to Java Programming编程题9.4<求某个字符的出现次数>
- Java——求一个字符串中大写字母,小写字母,非字母的个数分别是多少
- Introduction to Java Programming编程题9.13<回文字符串(在命令行传字符串)>
- Introduction to Java Programming编程题9.7<将字符串中的字符转换为数字>
- Introduction to Java Programming编程题9.11<对字符串中的字符排序(支持大小写混排)>
- introduction to Java Programming 编程题5.3<回文整数>
- Introduction to Java Programming编程题5.6<打印数字三角形>
- Introduction to Java Programming编程题5.13<数列求和>
- Introduction to Java Programming编程题5.14<计算数列>
- Introduction to Java Programming编程题5.17<01矩阵>
- Introduction to Java Programming编程题5.26<回文素数>
- Introduction to Java Programming编程题5.27<反素数>
- Introduction to Java Programming编程题5.29<掷骰子游戏>
- EventBus(一)
- 性能测试培训总结-spotlight on mysql
- 优化UITableView性能
- 性能测试培训笔记-全局变量和局部变量
- Pandas数据探索与实践
- Introduction to Java Programming编程题9.15<求字符串中大写字母的个数>
- Java 中使用内存映射文件需要考虑的 10 个问题
- finally块详解
- archlinux挂载ntfs没有写权限
- Html开发常用习惯之(二)
- Android Ethernet从上至下解析
- Android知识点2-Adapter中使用Intent跳转到另一个activity
- 新手遇到的失误点
- 一些性能测试计算公式