五彩缤纷
查看原帖
五彩缤纷
793359
Jeremy811楼主2023/3/27 21:59

三紫一红一绿

#include<bits/stdc++.h>
using namespace std;
int main(){
    string uns,trs;
    getline(cin,uns);
    for(int i=0;i<=uns.size();i++)
    {
        if(uns[i]=='A')
        {
            trs[i]='T';
        }
        else if(uns[i]=='T')
        {
            trs[i]='A';
        }
        else if(uns[i]=='G')
        {
            trs[i]='C';
        }
        else if(uns[i]=='C')
        {
            trs[i]='G';
        }
    }
    for(int j=0;j<=uns.size();j++)
    {
        cout<<trs[j];
    }
    return 0;
}

哪里有问题?

2023/3/27 21:59
加载中...