Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void charCount(char[] array) {
  4.         char sign = 'A';
  5.         for (int i = 0; i < 52; i++) {
  6.             if (i == 26)
  7.                 sign = 'a';
  8.             int count = 0;
  9.             for (int j = 0; j < array.length; j++) {
  10.                 if (array[j] == sign)
  11.                     count++;
  12.             }
  13.             if (count > 0)
  14.                 System.out.print(sign + " : " + count + "  ");
  15.             sign++;
  16.         }
  17.         System.out.println();
  18.     }
  19.  
  20.     public static void main(String[] args) {
  21.  
  22.         //ZADANIE3
  23.         char[] inscription = {'A','l','a','m','a','k','o','t','a'};
  24.         charCount(inscription);
  25.  
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement