package com.bjpowernode;
public class MyTest {
public static void main(String args[]) {
String sc = "want you to know one thing";
char c[] = sc.toCharArray();
int n1 = 0;
int n2 = 0;
for (int x = 0; x < sc.length();x++){
if (c[x] ==('n')){
n1++;
} else if (c[x] ==('o')){
n2++;
}
}
System.out.println("n的个数:" + n1);
System.out.println("o的个数:" + n2);
}
}