| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11162 | uppercase and lowercase |
|
| 11165 | Spiral Text |
|
Description
Given a string, output the number of uppercase letters,lowercase letters and others.
For example, "AEbW%9Q" consist of 4 uppercase letters, 1 lowercase letter and 2 (% 9).
Input
The input consist of a string. (0<length<1000)
Output
The number of uppercase letters,lowercase letters and others. Those three numbers are separated by a space. Note that you need to print‘\n’ at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
In this problem, you are asked to rearrange a given text in a square and output it in the "spiral form".
A square is an area with NxN grids. For a given text with length NxN, you put the first character in the upper-left grid. Then, you put the following N-1 characters to the right of the previous one, and you will reach the right border of the square. Any time you can't find an empty place on current direction, you turn "right" and place the next character untile you finish placing all characters and reach the center of the square.
The case below shows the result of a text "0123456789ABCDEF" in a 4x4 square:
0123
BCD4
AFE5
9876
Input
There are 2 lines for the input. The first shows the integer N (1<= N <= 8) denotes the size of the edges of the square. The following line is a text with exactly NxN characters. There might be Alphabets, numbers and spaces in the text.
If you use getchar() to fetch characters in the text, make sure you handle the "new line" ('\n') character in the first line properly.
Output
Print the texts in the square. There should be N lines in the output.