1 solutions

  • 0
    @ 2025-11-5 15:26:06

    C :

    #include<stdio.h>
    
    int main()
    {
    	char a,b;
    	scanf("%c",&a);
    	if(a>='a'&&a<='z'||a>='A'&&a<='Z'){
    		if(a>='a'&&a<='z'){
    			b=a;
    			a=b-32;
    			printf("%c",a);
    		}else{
    			b=a;
    			a=b+32;
    			printf("%c",a);
    		}
    	}else{
    		printf("bushizimu");
    	}
        return 0;
    }
    

    C++ :

    #include <iostream>
    #include <cstdio>
    using namespace std;
    int main()
    {
        char c;
        cin>>c;
        if(c>='a' && c<='z')
        {
            //如果是小写字母
            c=c-32;//转换成大写字母
            cout<<c<<endl;
        }
        else if(c>='A' && c<='Z')
        {
            //如果是大写字母
            c=c+32;//转换成小写字母
            cout<<c<<endl;
        }
        else
        {
            //如果c不是字母
            cout<<"bushizimu"<<endl;
        }    
        return 0;
    }
    
    • 1

    Information

    ID
    16784
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By