输出效果:
a b c d e f g h i g k l m n o p q r s t u v w x y z
b c d e f g h i g k l m n o p q r s t u v w x y z a
c d e f g h i g k l m n o p q r s t u v w x y z a b
...
z a b c d e f g h i g k l m n o p q r s t u v w x y
方法一:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char str[]={
"abcdefghijklmnopqrstuvwxyz"};
int temp;
int n=sizeof(str);
for(int j=0;j<n-1;j++)
{
temp=str[0];
for(int i=0;i<n;i++)
{
str[i]=str[i+1];
str[n-1]=temp;
}
for(int i=0;i<n;i++)
{
printf("%c",str[i]);