Verification of Palindromes and Character Counts


Submit solution

Points: 20
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

題目說明

<1122檢定考題,1131檢定考題>
你的程式要讓使用者輸入一個字,
然後判斷它是否為回文(Palindrome),
並計算該單字包含多少不同字元(區分大小寫)。

提示:本題的回文指一個字從左讀到右或從右讀到左都得到相同結果。

輸入

一個字。可包含大小寫英文字母、數字、"$"、"#"、"@"、"%"、"!"…等各種符號

輸出

輸出中的第一個數字表示是否為回文(是回文為1,不是回文為0),第二個數字表示該字包含多少不同字元的數量。

sample input & output

輸入 輸出
樣本1 Ada 0 3
樣本2 C-2-C 1 3
樣本3 Mama5&5amaM 1 5
樣本4 #$%#$%123123zxcvzxcvqwerty 0 16

Comments

There are no comments at the moment.