Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner genomeInput = new Scanner(System.in);
- System.out.print("Enter a genome string: ");
- String genome = genomeInput.nextLine();
- String[] genes = genome.split("[ATG], [TAG], [TAA], [TGA]");
- if (genes.length % 3 == 0){
- for (int i = 0; i < genes.length; i ++)
- System.out.println(genes[i]);
- }
- else
- System.out.println("no gene is found");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement