#T768. 系统说明书

系统说明书

Description

We refer to users who use CodesOnline as COIers. The OJ (Online Judge) publishes a usage guide for new COIers. However, since Xiao Ming, a COIer, is a citizen of Country B and cannot understand the language of Country A, he hopes you can programmatically explain the OJ's usage to him.

The difference between the languages of Country A and Country B is:
    The language of Country A uses only lowercase letters, while the language of Country B uses only uppercase letters.

Input Format

The input consists of a single line:
A string (with no more than 100 characters, containing only letters and spaces).

Output Format

The output consists of two lines:

  1. The first line directly outputs the converted text in the language of Country B.
  2. Since Xiao Ming reads from right to left, the second line outputs the converted text in reverse order.

Example

Input:
hello world

Output:
HELLO WORLD
DLROW OLLEH

Constraints

  • The input string will contain only letters (a-z, A-Z) and spaces.
  • The length of the input string will not exceed 100 characters.

Solution Code

s = input().strip()
upper_s = s.upper()
print(upper_s)
reversed_s = upper_s[::-1]
print(reversed_s)

Explanation

  1. Input Handling: The input string is read and stripped of any leading/trailing whitespace.
  2. Case Conversion: The string is converted to uppercase to match Country B's language.
  3. Output:
    • The first line prints the converted uppercase string.
    • The second line prints the reversed version of the uppercase string for Xiao Ming's reading convenience.

This ensures the solution meets the problem requirements efficiently.

if you need to use codesonline first you need to sign up a account
IF YOU NEED TO USE CODESONLINE FIRST YOU NEED TO SIGN UP A ACCOUNT
ACCOUNT A UP SIGN TO NEED YOU FIRST CODESONLINE USE TO NEED YOU IF

Hint

Reverse the order of the words, not the letters within each word.

Source

Original problem by CodesOnline