-->
当前位置:首页 > 题库

PROGRAMMING:A. Odd Palindrome

Luz5年前 (2021-05-10)题库390
We say that a string is odd if and only if all palindromic substrings of the string have odd length.
Given a string s, determine if it is odd or not.
A substring of a string s is a nonempty sequence of consecutive characters from s. A palindromic
substring is a substring that reads the same forwards and backwards.
Main idea:
Enter a string of length n (n < = 100) containing only lowercase letters. If all palindrome substrings are odd in length, output odd,
Otherwise output or not
### Input:
The input consists of a single line containing the string s (1 ≤ |s| ≤ 100).
It is guaranteed that s consists of lowercase ASCII letters (‘a’–‘z’) only.
### Output:
If s is odd, then print “Odd.” on a single line (without quotation marks). Otherwise, print “Or
not.” on a single line (without quotation marks).
### Sample Input:
```in
amanaplanacanalpanama
madamimadam
annamyfriend
nopalindromes
```
### Sample Output:
```out
Odd.
Odd.
Or not.
Odd.
```






answer:If there is no answer, please comment