From 2704b9d6b9cfcc8427d35e7af4285ccb3025772d Mon Sep 17 00:00:00 2001 From: w99wen Date: Mon, 1 Jun 2015 10:05:06 +0800 Subject: [PATCH] add question description --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ bin/main.class | Bin 2395 -> 2436 bytes src/main.java | 11 +++++++---- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 81742bb..b7f08d3 100644 --- a/README.md +++ b/README.md @@ -1 +1,52 @@ # Broken_Keyboard + +##Problem Description +``` + +On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters +corresponding to those keys will not appear on screen. + +Now given a string that you are supposed to type, and the string that you actually type out, please list those keys +which are for sure worn out. +输入描述: +Each input file contains one test case. For each case, the 1st line contains the original string, and the 2nd line contains the typed-out string. Each string contains + +no more than 80 characters which are either English letters [A-Z] (case + +insensitive), digital numbers [0-9], or "_" (representing the space). It is guaranteed that both strings are non-empty. + + +输出描述: +For each test case, print in one line the keys that are worn out, in the order of being detected. The English letters must be capitalized. + +Each worn out key must be printed once only. It is guaranteed that there is at least one worn out key. + +输入例子(input case): +7_This_is_a_test +On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters +corresponding to those keys will not appear on screen. + +Now given a string that you are supposed to type, and the string that you actually type out, please list those keys +which are for sure worn out. +输入描述: +Each input file contains one test case. For each case, the 1st line contains the original string, and the 2nd line contains the typed-out string. Each string contains + +no more than 80 characters which are either English letters [A-Z] (case + +insensitive), digital numbers [0-9], or "_" (representing the space). It is guaranteed that both strings are non-empty. + + +输出描述: +For each test case, print in one line the keys that are worn out, in the order of being detected. The English letters must be capitalized. + +Each worn out key must be printed once only. It is guaranteed that there is at least one worn out key. + +输入例子: +7_This_is_a_test + +_hs_s_a_es + +输出例子: +7TI + +``` diff --git a/bin/main.class b/bin/main.class index 8b71dd3d6f48f74599e436b7a41b3336692fa675..d1d96a04e61bc4ad4a0c82018a46f65f91e6709b 100644 GIT binary patch literal 2436 zcmZ`)-%ne06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4Cxr)#O+17JDb>m&~*+;5%s*EPGhM8||8=ZnBs$gYY7t zLxoSEW!x&57pwVsvpi+Y=S+dncrk6{rj4>C_v?p>owX|THZEfg3hau`jBf->*=4J+ zIM_8EKr2ETwr_%xTCUh;UdImXB#dH}sKTzXRqVY)OPltlkstJ97Y+MorxDY(; z0$NF8%oPZGi#QIeMtPC!?AU@6KMn~Xh$vzjx;FFTu%@FMae*egc%@V_%Sofc9PEs4 z309y-N3XoNIWWhTDgo__M@K=O2tab zHp+JAP-hUw@vll;7`R$@xep35Y9pjjwb~QE zq@?MRdqDdrF6&5PioD%2a#d6EcIZiPZvPB6-f~a|pO*KzDtSmYYCH-5x{UI=%*hst zbQQ%LI&R4P1=7WQ$tassMP}D3lw_NP8mM9G`Pe~@v?*^@D(t&UOc}H1*jy>4odVKb zrTVrtS1c^Dmr~Vvmn`yD&$fUV6WGSgr*BReC8yyvSY&!;#$oEFjvVqtSgFoeoSK#W zKej~$5S^!TR6dT;+^G~{&_A7tCH^?2Zc#eJc)?V$T27m1Eje-ma;o&m+GNMklEV#9 zxZ;T7Q{%3eZ#ELt*hBcg!GkZ{Ju|weKO+8+THh65mqIFm9>v!9qk!qu0xrtVQC|4!^{*gMBu~ZZiLr4 zMJ7ji?IiPX8V8v#PGs_P4khxt%rX2f&p)L66HGX)Uv@8z0y&hQ6%@H*pW}1dE|B#m zd`9a9vL2!3Tgew|?S9x?X%7Ea5!BYuR!@Ks8u*Vu>Q&J`BGy@~ diff --git a/src/main.java b/src/main.java index d07f344..6791249 100644 --- a/src/main.java +++ b/src/main.java @@ -2,13 +2,16 @@ public class main { public static void main(String[] args) { // TODO Auto-generated method stub - System.out.println(func("7_This_is_a_test", "_hs_s_a_es")); + System.out.println("the broken keys are:" +func("7_This_is_a_test", "_hs_s_a_es")); } - /* - * 7_This_is_a_test _hs_s_a_es + /* characters typed: + * 7_This_is_a_test + * --------------- + * characters on screen: + * _hs_s_a_es */ - + static public String func(String input, String output) { String missingPart = ""; String inputUpcase = input.toUpperCase();