2 条题解

  • 0
    @ 2025-5-1 22:20:19
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	char a;
    	cin>>a;
    	int b=0;
    	int y=(int)a;
    	char s;
    	if(y<=122 and y>=97){
    		y=y-32;
    		s=(char)y;
    		cout<<s;
    	}else{
            cout<<a;
        }
    	return 0;
    } 
    
    • 0
      @ 2024-12-24 9:59:30

      C :

      #include <stdio.h>
      
      int main()
      {
      	char str;
      	scanf("%c",&str);
      	printf("%c",(str>=65&&str<97)?str:str-32);
      	
      	return 0;
      }
      

      C++ :

      #include<iostream>
      using namespace std;
      
      int main()
      {
      	char c,d;
      	cin>>c;
          d=(c>='a'&&c<='z')?c-32:c;
      	cout<<d<<endl;
      	return 0;
      }
      
      • 1

      信息

      ID
      1639
      时间
      1000ms
      内存
      128MiB
      难度
      10
      标签
      递交数
      2
      已通过
      1
      上传者