String input string, which will be made lowercase uppercase letters, lowercase letters, uppercase into output. Then reverse output

#include <stdio.h>
#define N  100
char main()
{
    char a[N],b[N]={0};
    int i;
    gets(a);
  for(i=0;i<=N;i++)
  {

           if(a[i]>='a'&&a[i]<='z')
              b[i]=a[i]-32;
          else if(a[i]>='A'&&a[i]<='Z')
              b[i]=a[i]+32;        
  } 
    i--;
while (i>=0)
	cout<<b[i--];
}

Guess you like

Origin blog.csdn.net/weixin_43822669/article/details/92366734