4 条题解

  • 1
    @ 2026-8-13 10:08:19
    # include <bits/stdc++.h>
    
    using namespace std;
    string s,s1;
    int main(){
    	cin>>s;
    	for(int i = 0;i<s.size();i++){
    		switch(s[i]){
    			case 'A':s1+='T';break;
    			case 'T':s1+='A';break;
    			case 'G':s1+='C';break;
    			case 'C':s1+='G';break;
    		}
    	}
    	cout<<s1;
    	return 0;
    }
    
    • 0
      @ 2025-4-18 17:29:55
      #include<iomanip> 
      #include<cmath> 
      #include<cstdio> 
      #include<cstring> 
      #include<algorithm> 
      const int N=1e7+8;
      const int INF=0x3f3f3f3f;
      using namespace std;
      int n,m;
      char a[N],b[N];
      int main()
      {
      	cin>>a;
      	int len=strlen(a);
      	for(int i=0;i<len;i++)
      	{
      		if(a[i]=='A')
      		{
      			b[i]='T';
      		}
      		else if(a[i]=='T')
      		{
      			b[i]='A';
      		}
      		else if(a[i]=='G')
      		{
      			b[i]='C';
      		}
      		else if(a[i]=='C')
      		{
      			b[i]='G';
      		}
      	}
      	cout<<b;
      	return 0;
      }
      
      
      • 0
        @ 2023-1-4 12:20:07
        #include<bits/stdc++.h>
        using namespace std;
        char ch;
        char findd(char x)
        {
        	if(x=='A')return 'T';
        	if(x=='T')return 'A';
        	if(x=='G')return 'C';
        	return 'G';
        }
        int main()
        {
        	ios::sync_with_stdio(false);
        	cin.tie(0);
        	cout.tie(0);
        	while(cin>>ch)
        	{
        		cout<<findd(ch);
        	}
        	return 0;
        }
        
        • -1
          @ 2023-3-31 21:02:34
          #include <bits/stdc++.h>
          char turn(char x){
          	if(x == 'A'){return 'T';}
          	else if(x == 'T'){return 'A';}
          	else if(x == 'G'){return 'C';}
          	else{return 'G';}
          }
          char a[114514];
          using namespace std;
          const int N = 1e5 + 10;
          const int INF = 0x3f3f3f3f;
          int main(){
          	cin >> a;
          	for(int i = 0;i < strlen(a);i++)
          		cout << turn(a[i]);
          	}
          	return 0;
          	}
          
          • 1

          信息

          ID
          1122
          时间
          1000ms
          内存
          128MiB
          难度
          3
          标签
          递交数
          147
          已通过
          78
          上传者