一道基础的c语言编程

这个怎么写啊,刚刚开始学想要简单易懂一点的,太复杂的看不懂,谢谢

img

供参考:

#include <stdio.h>
int main()
{
    char s[102];
    int  i = 0;
    scanf("%s", s);
    while (s[i]){
         if (s[i]>='a' && s[i]<='z')
             s[i] -= 32;
         else if (s[i]>='A' && s[i]<='Z')
             s[i] += 32;
         i++;
    }
    printf("%s", s);
    return 0;
}

#include <stdio.h>
#include <ctype.h>//只有用这个,后面才能用判断大小的函数
int main()
{
    char s[102];
    int  i = 0;
    scanf("%s", s);
    while (s[i]){
         if(islower(s[i])//判断是小写
             s[i] -= 32;
         else if (isupper(s[i])//判断是大写
             s[i] += 32;
         i++;
    }
    printf("%s", s);
    return 0;
}