摘要: 题目大意: 求字符串的最小周期数.eg.hohoho的最小周期是2. 解题思路: 枚举一个周期与相邻一个周期的字母进行比较. 阅读全文
posted @ 2018-04-16 11:46 远山笑你 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; //p表示的序列是否比q表示的序列字典序小 int less(const char* s,int p,int q) { int n=strlen(s); for(int i=0; i<n; i++) { if( 阅读全文
posted @ 2018-04-16 11:43 远山笑你 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 我的思路是从后面开始遍历整个数组。 从前面开始遍历的话,有一个公式需要掌握: t=0; t=t*10+(c[i]-'0'); 实现数字的处理。 #include<bits/stdc++.h>using namespace std;double f(char a){ if(a=='C') return 阅读全文
posted @ 2018-04-16 11:41 远山笑你 阅读(117) 评论(0) 推荐(0) 编辑