uva 10785 - The Mad Numerologist
The Mad Numerologist
Numerology is a science that is used by many people to find out a mans personality, sole purpose of life, desires to experience etc. Some calculations of numerology are very complex, while others are quite simple. You can sit alone at home and do these easy calculations without taking any ones help. However in this problem you wont be asked to find the value of your name.
To find the value of a name modern numerologists have assigned values to all the letters of English Alphabet. The table on the left shows the numerical values of all letters of English alphabets. Five letters A, E, I, O, U are vowels. Rests of the letters are consonant. In this table all letters in column 1 have value 1, all letters in column 2 have value 2 and so on. So T has value 2, F has value 6, R has value 9, O has value 6 etc. When calculating the value of a particular name the consonants and vowels are calculated separately. The following picture explains this method using the name ``CHRISTOPHER RORY PAGE".
So you can see that to find the consonant value, the values of individual consonants are added and to find the vowel value the values of individual vowels are added. A mad Numerologist suggests people many strange lucky names. He follows the rules stated below while giving lucky names.
Input
First line of the input file contains an integer N (0 < N250) that indicates how many sets of inputs are there. Each of the nextN lines contains a single set of input. The description of each set is given below: Each line contains an integern ( 0 < n < 211) that indicates the predefined length of the name.
Output
For each set of input produce one line of output. This line contains the serial of output followed by the name that the numerologist would suggest following the rules above. All letters in the output should be uppercase English letters.
Sample Input
3
1
5
5
Sample Output
Case 1: A
Case 2: AJAJA
Case 3: AJAJA
26개의 알파벳 값을 요구사항에 따라 n의 시퀀스로 구성합니다.
1 문자열 총 권한 최소
2 홀수 위치 모음 짝수 위치 자음
3모음은 21번, 자음은 5번...
4 사전 순서에 따라 최소 구조
마지막 조건을 주의하지 않고 직접 구성하여 출력한 줄 알았기 때문에 먼저 욕심법에 따라 필요한 자모를 선택한 다음에 사전순으로 정렬하면 된다.
#include
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
java에서 InputStream, String, File 간의 상호 전환 비교InputStream, String, File 상호 전환 1. String --> InputStream 2. InputStream --> String 오늘 인터넷에서 또 다른 방법을 보았는데, 특별히 가지고 와서 공...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.