substr()字符串截取
原型
string substr (size_t pos = 0, size_t n = npos) const;
pos:自然数:从第pos个下标开始截取;
负数:从倒数第pos个字符开始截取。
n:截取字符个数,若输入0或负数,则返回空。
__gcd() c++自带的求最大公约数的函数
用于求x,y的最大公约数
头文件:#include< algorithm>
原型:
int __gcd( int x, int y );
字符串1+字符串2==字符串2+字符串1
一定存在公约子串