C language · List of Amoy

Source: Internet
Author: User

Algorithm Gao list time limit: 100ms memory limit: 8.0MBProblem description by zby ...:) Amoy got a list, he wanted to deal with the above name, pick out some special names, he asked you to help.
Amoy focus on the following names:
If the name is "Wys", he wants your program to output "KXZSMR".
If the name is "CQ", he wants your program to output "Chaiqiang".
If the name is "LC", he wants your program to output "Dragonnet".
If the name is "SYT" or "SSD" or "LSS" or "LYF", he wants your program to output "Studyfather".
If the name is not the same as any of the above names, he wants your program to output "denominator". Input format the first line has an integer n, which indicates the number of people on the list of Amoy.
Next n lines, each line has a string, that is, the name of the list. Output format output n rows, each row outputs the judging result of each person's name. Sample Input 9
Wys
CQ
Wys
LC
SYT
Ssds
LSS
LYF
Zby Sample Output KXZSMR
Chaiqiang
Kxzsmr
Dragonnet
Studyfather
Studyfather
Studyfather
Studyfather
Denominator data size and conventions for 50% data, N <= 1000, and names in the list may only be "Wys", "CQ", "LC" one of the three, no other name.
For 100% data, N <= 10000, a person's name consists only of uppercase letters, not exceeding 5 in length.
1#include <stdio.h>2#include <string.h>3 intMain ()4 {5     intN;6     Charname[Ten];7scanf"%d",&n);8      for(intI=0; i<n;i++)9     {Tenscanf"%s", name); One         if(strcmp (Name,"Wys")==0) Aprintf"kxzsmr\n"); -              -         Else if(strcmp (Name,"CQ")==0) theprintf"chaiqiang\n"); -              -         Else if(strcmp (Name,"LC")==0) -printf"dragonnet\n"); +              -         Else if(strcmp (Name,"SYT")==0) +printf"studyfather\n"); A              at         Else if(strcmp (Name,"SSD")==0) -printf"studyfather\n"); -              -         Else if(strcmp (Name,"LSS")==0) -printf"studyfather\n"); -          in         Else if(strcmp (Name,"LYF")==0) -printf"studyfather\n"); to          +         Else -printf"denominator\n"); the          *     } $     return 0;Panax Notoginseng}

C language · List of Amoy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.