设一个s为长度n的字符串,其中字符各不相同计算s中的互异平凡子串
#include<stdio.h>
#include<string.h>
int main()
{
int i=0,j,k,n;
char*p,*q,*s="abcdef";
n=strlen(s);
p=s;
for(k=1;k<n;k++)
{
q=p;
while(q<=p+n-k)
{
for(j=0;j<k;j++)
{
printf("%c",*(q+j));
}
printf(" ");
i++;
q++;
}
}
}