Various strings, find the number of uppercase and lowercase English characters

From , 3 Years ago, written in Java, viewed 224 times.
URL https://pastebin.vip/view/270edd69
  1. import java.util.*;
  2. public class Main{
  3.     public static void main(String[] args) {
  4.          Scanner scan = new Scanner(System.in);
  5.          String s = scan.nextLine();
  6.          int Num = 0, num = 0, i;
  7.          int n = s.length();
  8.          for(i = 0; i < n; i++) {
  9.                  if(s.charAt(i)>='A' && s.charAt(i)<='Z')
  10.                          Num++;
  11.                  else if(s.charAt(i)>='a' && s.charAt(i)<='z')
  12.                          num++;
  13.          }
  14.          System.out.println(Num);
  15.          System.out.println(num);
  16.          System.out.println(n-Num-num);
  17.                
  18.          scan.close();  
  19.     }
  20. }  

Reply to "Various strings, find the number of uppercase and lowercase English characters"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website