Count type of Characters
Submissions: 2715   Accuracy:

39.76%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given a string S, write a program to count the occurrence of Lowercase characters, Uppercase characters, Special characters and Numeric values in the string.

Input:
First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a string S.
Output:
For each test case, print four lines. In the first line print the count of upper case letters, in the second line print the count of lower case letters, in the third line print the count of numbers and in the fourth line print the count of special characters present in the string S.

Note: The strings doesnot contains whitespaces.

Constraints:
1<=T<=100
1<=length(S)<=100000

Example:
Input:

2
#GeeKs01fOr@gEEks07
*GeEkS4GeEkS*
Output:
5
8
4
2
6
4
1
2

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Harsh Agarwal
Author: harsh.agarwal0


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.