F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Typing

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1535    Accepted Submission(s): 891


Problem Description
A boy named Pirates who wants to develop typing software finds that it¡¯s hard to judge whether a letter is lowercase or uppercase. He searches lots of information about it, and find out the solution, but he doesn¡¯t know how to realize it. Can you help him?
  
The Solution:
1: If the caps lock is on, and the letter is typed with shift key down, the letter is lowercase, otherwise it¡¯s uppercase.
2: If the caps lock is off, and the letter is typed with shift key down, the letter is uppercase, otherwise it¡¯s lowercases.
 

Input
  The first line is an integer t, which is the number of test case in the input data file. Each test case begins with an integer n (0<n<=100), which means there follow n lines. For each line, if there is only a letter, it means the key is typed, and if there begins with a string ¡°Shift¡±, then will follows one letter, it means the letter is typed with shift key, and if there begins with a string ¡°Caps¡±, it means the caps lock key is typed and changes the mood of caps lock. The entire letter is lowercase. At the beginning of each test case, you can assume that the caps lock is off.
 

Output
Please output a string which the user typed.
 

Sample Input
2 5 Caps a c Shift i Shift t 6 Caps a c Caps i t
 

Sample Output
ACit ACit
 

Author
Dellenge
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 09:59:20, Gzip enabled