用指针实现,实现过程无需将子串复制到一个新的字符串中。(10分)
题目内容:
用指针实现,实现过程无需将子串复制到一个新的字符串中。
输入格式:
字符串
输出格式:
子串
输入样例:
computer
输出样例:
computer
omputer
mputer
puter
uter
ter
er
r
code
#include "stdio.h"
int main()
{
char s[30];
char * p =s;
scanf("%s",p);
int i;
for (i=0;i<sizeof(p);i++)
{
printf("%s\n",p+i );
}
return 0;
}