在密碼學裡面有一種很簡單的加密方式,就是把原始資料的每個字元通通加上某一個整數K而得到密碼的字元(原始資料及密碼字元一定都在ASCII碼中可列印的範圍內)。例如若K=2,那麼apple經過加密後就變成crrng了;解密則是反過來做。 輸入說明:第一列為加密的K值,第二列為要解密的列數,第三列及以後就是需要解密的字串。(請參照輸入範例) 輸入範例:in.txt 7 3 1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5 1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5 1KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5 輸出說明:對每一測試資料,請輸出解密後的原始資料。(請參照輸出範例) 輸出範例:out.txt *CDC is the trademark of the Control Data Corporation. *IBM is a trademark of the International Business Machine Corporation. *DEC is the trademark of the Digital Equipment Corporation.
輸入範例: 2 He works hard from morning till night. He is a hard worker. I once heard him speaking in English. He is a very good speaker of English . 輸出範例: 10