| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12976 | Number Pyramid Pt 2 |
|
| 12977 | Transcribe Numbers |
|
| 12978 | Palindrome Detection |
|
Description
Write a program that asks the user to input a positive number n.
Let’s say the user inputs 5. Your program should output the following pattern:
Input
n, such that, 0 < n <= INT_MAX
Output
A sequence of:
- n, such that, 0 < n <= INT_MAX.
- "*" characters.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
- Write a program that asks the user for a two-digit number (10 ~ 99), then prints the English word for the number.
- Break the number into two digits.
- Use a switch statement to print the word for the first digit (i.e. twenty, thirty, etc).
- Use another switch statement to print the second digit.
- Deal with special cases: 11~19.
- If not a double digit number, print "invalid\n".
Input
0 < n <= 99
Output
- A string of characters.
- Or two strings of characters separated by a hyphen "-" character.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
- A palindrome a word such as “deed” or “level”, which is the same when you spell it backwards.
- Write a program that inputs a word (a sequence of lowercase letters) and determines whether or not the word is a palindrome. Each input word has at least 1 and at most 20 letters.
- Hint: By default, empty elements in character array contain “\0”.
Input
String of characters.
Output
"yes\n" or "no\n"