JAVA实现统计字符串的大小写字母、数字及其他字符的个数

玛丽莲梦兔
619次浏览
2020年08月01日 15:00
最佳经验
本文由作者推荐

cosc-必定的近义词

import r;
public class Count {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int numbers,capitalLetters,smallLetters,others;
numbers=capitalLetters=smallLetters=others=0;
("Please input a string:
");
Scanner s=new Scanner();
String str=();
n("Your string is:"+str);
for(int i=0;i<();i++)
{
char c=(i);
if(rCase(c))
{
smallLetters++;
}
else if(t(c))
{
numbers++;
}
else if(rCase(c))
{
capitalLetters++;
}
else
{
others++;
}
}
n("numbers ="+numbers);
n("capitalLetters ="+capitalLetters);
n("smallLetters ="+smallLetters);
n("others ="+others);
}

}

醒拼音-蜚怎么读


风玫瑰图怎么画-不劳而获的意思


绿色的寓意-英秀的意思


昆虫属于动物吗-殷红拼音


if函数大于小于区间-什么叫南南合作


贸贸然-虬枝


肯定的英语-赤金


笨拙的近义词-扎的近义词