Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void charCount(char[] array) {
- char sign = 'A';
- for (int i = 0; i < 52; i++) {
- if (i == 26)
- sign = 'a';
- int count = 0;
- for (int j = 0; j < array.length; j++) {
- if (array[j] == sign)
- count++;
- }
- if (count > 0)
- System.out.print(sign + " : " + count + " ");
- sign++;
- }
- System.out.println();
- }
- public static void main(String[] args) {
- //ZADANIE3
- char[] inscription = {'A','l','a','m','a','k','o','t','a'};
- charCount(inscription);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement