用指针实现,实现过程无需将子串复制到一个新的字符串中。(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;	
}

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案