想求一下程序流程图,关于c语言的

img

img


程序说明:从键盘上输入一个字符,如果是大写字母,则转换成小写字母,如果是小写字母,转换成大写字母,如果是数字字符,转换成该数字所对应的数值的平方。否则原样输出。

程序流程图?


#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;

    printf("Enter a character: ");
    c = getchar();

    if (isupper(c))
    {
        printf("%c\n", tolower(c));
    }
    else if (islower(c))
    {
        printf("%c\n", toupper(c));
    }
    else if (isdigit(c))
    {
        printf("%d\n", (c - '0') * (c - '0'));
    }
    else
    {
        printf("%c\n", c);
    }

    return 0;
}

该程序会要求用户输入一个字符,然后根据你所描述的规则进行转换并输出。