Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- void findMatchedGenome(string genome1,string genome2,string genome3,string seq);
- int main(void) {
- //Declaring variables
- findMatchedGenome("TTC","GCC","TCT","");
- return 0;
- }
- void findMatchedGenome(string genome1,string genome2,string genome3,string seq)
- {
- if(genome1.compare("")==0 || genome2.compare("")==0||genome3.compare("")==0|| seq.compare("")==0)
- {
- cout<<"Genomes or sequence is empty."<<endl;
- }
- else if(genome1.length()!=genome2.length() ||
- genome2.length()!=genome3.length() ||
- genome3.length()!=genome1.length())
- {
- cout<<"Lengths of genomes are different."<<endl;
- }
- else
- {
- if(genome1.compare(seq)==0)
- {
- cout<<"Genome1 is matched to sequence."<<endl;
- }
- else if(genome2.compare(seq)==0)
- {
- cout<<"Genome2 is matched to sequence."<<endl;
- }
- else if(genome3.compare(seq)==0)
- {
- cout<<"Genome3 is matched to sequence."<<endl;
- }
- else
- {
- cout<<"No Genome is matched to sequence."<<endl;
- }
- }
- }
- ___________________________
- Output:
- https://media.cheggcdn.com/media/3af/3af724e3-f6a0-4c87-9f7b-3c62fd4c6f86/phpJeNJal.png
Advertisement
Add Comment
Please, Sign In to add comment