Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class solution {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String str = sc.nextLine();
- int capital = 0, small = 0;
- for (int i = 0; i < str.length(); i++) {
- if ((int) str.charAt(i) >= 65 && (int) str.charAt(i) <= 90) {
- capital++;
- } else if ((int) str.charAt(i) >= 97 && (int) str.charAt(i) <= 122) {
- small++;
- }
- }
- System.out.println(capital + " " + small);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement