题目链接:

B. Lovely Palindromes

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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?

Input

The only line of the input contains a single integer n (1 ≤ n ≤ 10100 000).

Output

Print the n-th even-length palindrome number.

Examples
input
1
output
11
input
10
output
1001

题意:

问长度为偶数的第n个回文数是多少;

思路:

把这个字符串输出一遍再倒过来输出一遍就是答案了;

AC代码:
//#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <queue>
#include <cmath>
#include <map>
#include <cstring>
#include <algorithm>
#include <cstdio> using namespace std;
#define Riep(n) for(int i=1;i<=n;i++)
#define Riop(n) for(int i=0;i<n;i++)
#define Rjep(n) for(int j=1;j<=n;j++)
#define Rjop(n) for(int j=0;j<n;j++)
#define mst(ss,b) memset(ss,b,sizeof(ss));
typedef long long LL;
template<class T> void read(T&num) {
char CH; bool F=false;
for(CH=getchar();CH<''||CH>'';F= CH=='-',CH=getchar());
for(num=;CH>=''&&CH<='';num=num*+CH-'',CH=getchar());
F && (num=-num);
}
int stk[], tp;
template<class T> inline void print(T p) {
if(!p) { puts(""); return; }
while(p) stk[++ tp] = p%, p/=;
while(tp) putchar(stk[tp--] + '');
putchar('\n');
} const LL mod=1e9+;
const double PI=acos(-1.0);
const LL inf=1e18;
const int N=1e5+;
const int maxn=;
const double eps=1e-; char s[N];
int main()
{ scanf("%s",s);
int len=strlen(s);
for(int i=;i<len;i++)
{
printf("%c",s[i]);
}
for(int i=len-;i>=;i--)
{
printf("%c",s[i]);
} return ;
}

最新文章

  1. spider RPC框架的需求来源与特性介绍(一)
  2. linux用户管理(二)
  3. python走起之第十一话
  4. SQL Server 2012 AlwaysOn 亲身实历记
  5. 个性二维码开源专题&lt;液化/圆角/效果&gt;
  6. Verilog语法基础讲解之参数化设计
  7. 四则运算三+psp0级表格
  8. Hacker(四)----查看计算机的IP地址
  9. POJ 3376 Finding Palindromes(扩展kmp+trie)
  10. java编程基础复习-------第二章
  11. angularJS的一点小笔记
  12. Crazy Calendar (阶梯博弈变形)
  13. Nginx性能优化技巧(6)
  14. Oracle ADDM报告生成和性能分析
  15. Ehcache计算Java对象内存大小
  16. python前后端加密方式
  17. C# 窗体内有子控件时鼠标检测
  18. 利用sqoop将hive数据导入导出数据到mysql
  19. 给Ubuntu18.04安装mac os主题&lt;转载&gt;
  20. Oracle ORA-12541:TNS:无监听程序

热门文章

  1. sql 四舍五入保留两位小数
  2. 使用HttpWebRequest post数据时要注意UrlEncode
  3. Linux内核设计与实现——读书笔记2:进程管理
  4. msp430入门编程42
  5. python学习之-- 进程 和 线程
  6. C# DataGridView,右键单击RowHeader时显示右键菜单怎么做?
  7. linux的bc命令介绍
  8. linux字符驱动之poll机制按键驱动
  9. 怎样更好的设计你的REST API之基于REST架构的Web Service设计及REST框架实现
  10. C# 中用DES 对称Key,IV 加密,前端crypto.js 解密