Codeforces Round #360 (Div. 2)-B. Lovely Palindromes
来源:互联网 发布:漆黑的特快列车 知乎 编辑:程序博客网 时间:2024/05/16 07:46
原题链接
Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 are not.
Pari is trying to love them too, but only very special and gifted people can understand the beauty behind palindrome numbers. Pari loves integers with even length (i.e. the numbers with even number of digits), so she tries to see a lot of big palindrome numbers with even length (like a 2-digit 11 or 6-digit 122221), so maybe she could see something in them.
Now Pari asks you to write a program that gets a huge integer n from the input and tells what is the n-th even-length positive palindrome number?
The only line of the input contains a single integer n (1 ≤ n ≤ 10100 000).
Print the n-th even-length palindrome number.
1
11
10
1001
The first 10 even-length palindrome numbers are 11, 22, 33, ... , 88, 99 and 1001.
只需要把输入的数和它反向的数链接就是所要的回文串了
#include <bits/stdc++.h>using namespace std;int main(){string s;cin >> s;cout << s;for(int i = s.size()-1; i >= 0; i--) printf("%c", s[i]);puts("");return 0;}
- Codeforces Round #360 (Div. 2) B. Lovely Palindromes
- Codeforces Round #360 (Div. 2) B Lovely Palindromes(水题)
- Codeforces Round #360 (Div. 2) B. Lovely Palindromes
- Codeforces Round #360 (Div. 2)-B. Lovely Palindromes
- Codeforces Round #360 (Div. 2) B. Lovely Palindromes
- Codeforces Round #360 (Div. 2) B Lovely Palindromes
- Codeforces-688B Lovely Palindromes
- CodeForces 688B Lovely Palindromes
- CodeForces 688B - Lovely Palindromes
- codeforces 688B Lovely Palindromes
- 688B: Lovely Palindromes
- B. Lovely Palindromes
- CodeForces 688B Lovely Palindromes(偶数位回文数)
- Codeforces Round #265 (Div. 2) C.No to Palindromes!
- Codeforces Round #265 (Div. 2) C. No to Palindromes!
- Codeforces Round #265 (Div. 2) C. No to Palindromes!
- Codeforces Round #265 (Div. 2) C - No to Palindromes!
- C. Primes or Palindromes?-Codeforces Round #315 (Div. 2)
- Hive内置数据类型
- 无线信道平率段划分
- 摄影需要训练一双能发现不同点的眼睛
- Android图片加载选择
- 剑指offer系列-T9_4矩形覆盖
- Codeforces Round #360 (Div. 2)-B. Lovely Palindromes
- 55. Jump Game
- Codeforces Round #360 (Div. 2) E. The Values You Can Make
- Spring MVC入门第2天--Spring、SpringMVC与MyBatis三大框架整合
- 解决sqoop java.util.NoSuchElementException
- ACM第三次练习—1010
- 为什么有人说富坚义博有着殿堂级的画功?他的画功体现在哪儿呢?
- iot 表索引dump《2》
- Ubuntu 16.04 64位 Sublime build3114 不支持搜狗输入法的解决方案