解题思路:
(1)遍历,对应修改
char *dna_strand(const char *dna) {
char *str = calloc(strlen(dna)+1,sizeof(char));
int count = 0;
while(*dna!='\0') {
switch(*dna) {
case 'A':
str[count++]='T';dna++;break;
case 'T':
str[count++]='A';dna++;break;
case 'C':
str[count++]='G';dna++;break;
case 'G':
str[count++]='C';dna++;break;
default:break;
}
}
str[count] = '\0';
return str;
}