3 条题解

  • 0
    @ 2026-5-17 12:01:15

    ****《真8级题目》 不会的请 豆包 deepseek 刷新 试试手气 特简单

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        string s;
        getline(cin,s);
        for(int i=0;s[i]!='\0';i++){
            if(isupper(s[i]))cout<<(char)(s[i]+32);
            else if(islower(s[i]))cout<<(char)(s[i]-32);
            else cout<<s[i];
        }
    }
    
    • -1
      @ 2023-4-15 23:08:39
      #include <bits/stdc++.h>
      using namespace std;
      int main(){
      	string a;
      	getline(cin,a);
      	for(int i = 0 ; i <= a.size() - 1 ; i++){
      		if(a[i] >= 'A' && a[i] <= 'Z') a[i] += 32;
      		else if(a[i] >= 'a' && a[i] <= 'z') a[i] -= 32;
      		cout << a[i];
      	}
      	return 0;
      }
      • -1
        @ 2023-4-15 22:04:15

        我绝对不会告诉你我比赛几乎全程都在水csdn和LaTeX\LaTeX,4道题全部都是乱打的

        特判多麻烦直接^32大小写直接转换

        #include<bits/stdc++.h>
        using namespace std;
        char ch;
        int main(){
        	while(cin.get(ch)){
        		if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z'){
        			printf("%c",(char)(ch^32));
        		}else{
        			printf("%c",ch); 
        		}
        	}
        	return 0;
        }
        
        
        • 1

        信息

        ID
        1888
        时间
        1000ms
        内存
        256MiB
        难度
        8
        标签
        (无)
        递交数
        664
        已通过
        78
        上传者