import java.util.*;
public class Problem {
/**
* @param args
*/
final static int SIZE = 100;
public static void main(String[] args) {
// TODO Auto-generated method stub
char[] chars = new char[SIZE];
int[] list = new int[SIZE];
int size;
Scanner input = new Scanner(System.in);
System.out.print("please input a string : ");
String string = input.nextLine().replace(" ", "").toLowerCase();
size = countChar(string, chars, list);
for (int i = 0; i < size; i++)
if (list[i] == 1)
System.out.println(chars[i] + " appears " + list[i] + " time ");
else
System.out
.println(chars[i] + " appears " + list[i] + " times ");
}
public static int countChar(String s, char[] c, int[] l) {
int j, size = 0;
for (int i = 0; i < s.length(); i++) {
for (j = 0; j < size; j++)
if (s.charAt(i) == c[j]) {
size--;
break;
}
c[j] = s.charAt(i);
l[j]++;
size++;
}
return size;
}
}
public class Problem {
/**
* @param args
*/
final static int SIZE = 100;
public static void main(String[] args) {
// TODO Auto-generated method stub
char[] chars = new char[SIZE];
int[] list = new int[SIZE];
int size;
Scanner input = new Scanner(System.in);
System.out.print("please input a string : ");
String string = input.nextLine().replace(" ", "").toLowerCase();
size = countChar(string, chars, list);
for (int i = 0; i < size; i++)
if (list[i] == 1)
System.out.println(chars[i] + " appears " + list[i] + " time ");
else
System.out
.println(chars[i] + " appears " + list[i] + " times ");
}
public static int countChar(String s, char[] c, int[] l) {
int j, size = 0;
for (int i = 0; i < s.length(); i++) {
for (j = 0; j < size; j++)
if (s.charAt(i) == c[j]) {
size--;
break;
}
c[j] = s.charAt(i);
l[j]++;
size++;
}
return size;
}
}