标签:成功 namespace 序列 限制 ios break new font pre
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 string a; 6 string b; 7 while(cin>>a>>b) 8 { 9 int count = 0; 10 int length_a = a.size(); 11 int length_b = b.size(); 12 for(int i = 0;i<length_a;i++) 13 { 14 switch(a[i]) 15 { 16 case ‘A‘: 17 if(b[i] == ‘T‘) 18 break; 19 else 20 { 21 count++; 22 break; 23 } 24 case ‘C‘: 25 if(b[i] == ‘G‘) 26 break; 27 else 28 { 29 count++; 30 break; 31 } 32 case ‘G‘: 33 if(b[i] == ‘C‘) 34 break; 35 else 36 { 37 count++; 38 break; 39 } 40 case ‘T‘: 41 if(b[i] == ‘A‘) 42 break; 43 else 44 { 45 count++; 46 break; 47 } 48 } 49 } 50 cout<<count<<endl; 51 } 52 return 0; 53 }
标签:成功 namespace 序列 限制 ios break new font pre
原文地址:http://www.cnblogs.com/qqky/p/7027571.html