求一个字符串中相同的连续中最长的部分,用c语言

[复制链接]
查看11 | 回复2 | 2012-2-16 15:25:48 | 显示全部楼层 |阅读模式
#include "stdio.h"//返回最大的重复次数 及其起始地址和起始序号 次数和序号以0为起始int maxRepeated(char* buf, char* *p, int *state)//input:buf output: p,state{int imax=0,i=0,j=0;char *p0,*plast;p0 = plast = buf;while(*p0)//imax){imax = i;*p = plast...
回复

使用道具 举报

千问 | 2012-2-16 15:25:48 | 显示全部楼层
int main(){
char s[]="1112222345",maxc;
int n,sum,i,j,sn=1;
int maxn=0;
n=strlen(s);
for(i=0;i<n-1;i++)
{
for(j=i;j<n-1;j++)
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行