倒顺字母字符串
#include <stdio.h>
const char str[50]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int main()
{
int n;
scanf("%d",&n);
if(n>=1&&n<=26)
{
if(n%2==0)
{
for(int i=0;i<n;i++)
printf("%c ",str[i]);
for(int j=n-1;j>=0;j--)
{
if(j!=0)
printf("%c ",str[j]);
else
printf("%c",str[j]);
}
}
else
{
for(int i=0;i<n;i++)
printf("%c ",str[i]);
for(int j=n-2;j>=0;j--)
{
if(j!=0)
printf("%c ",str[j]);
else
printf("%c",str[j]);
}
}
}
return 0;
}
俺这样为什么不行😭🙃