DNA -Übung
import java.util.Scanner;
public class DNA {
public static void main(String[] args) {
String sequence = StdIn.readString();
String complementary = "";
for (int i = 0; i < sequence.length(); i++) {
char nucleotide = sequence.charAt(i);
if (nucleotide=='A'){
complementary += 'T';
}else if (nucleotide=='T') {
complementary += 'A';
}else if (nucleotide=='C'){
complementary += 'G';
}else if (nucleotide=='G'){
complementary += 'C';
}
}
System.out.println(complementary);
}
}
Breakable Boar