package xiti5;
public class Third {
public static void main(String[] args) {
T t=new T("want you to know one thing ");
t.tell();
} }
class T{
private String str;
public T(String str){
this.str=str;
} public void tell(){
char c[]=str.toCharArray();//将字符串分解为字符数组
int n=0;
int m=0;
for(int i=0;i<c.length;i++){
if(c[i]=='n'){
n++;
}else
if(c[i]=='o'){
m++;
}
}
System.out.println("该字符串中n出现了"+n+"次,o出现了"+m+"次");
}
}

最新文章

  1. java第三次作业
  2. springmvc No mapping found for HTTP request with URI in Dispatc
  3. JS添加删除DIV
  4. NGif, Animated GIF Encoder for .NET
  5. CodeForces Round 199 Div2
  6. html5 教程网站
  7. Eyeshot Ultimate 学习笔记(1)
  8. kaggle之手写体识别
  9. checkbox之checked的方法(attr和prop)区别
  10. SharePoint 2010 Form Authentication (SQL) based on existing database
  11. Django:(博客系统)使用使用mysql数据&amp;创建post/category/tag实体,并同步到数据中
  12. 【一天一道LeetCode】#21. Merge Two Sorted Lists
  13. 细说shiro之五:在spring框架中集成shiro
  14. Redis内存模型总结
  15. A1103. Integer Factorization
  16. WijmoJS 全面支持 Angular 7
  17. 【LOJ】#2269. 「SDOI2017」切树游戏
  18. brainfuck 解释器
  19. less常见的操作
  20. 端口安全检查shell脚本

热门文章

  1. 开源3D游戏引擎Irrlicht简介
  2. request.getSession().getServletContext().getRealPath(&quot;&quot;)获取工程目录 路径修改
  3. Fastboot线刷“复活”之刷机心得(三)——错误处理
  4. C#运算符小例子
  5. js插件---video.js如何使用
  6. js函数的属性和方法
  7. IIS7下设置AD单点登录
  8. MyEclipse下怎么配置Maven
  9. Android 如何获取Android RecyclerView滑动的距离
  10. OpenCV —— 轮廓