Advertisement
arturParchem

Zadanie 1 informatyka.wsip.pl

May 20th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int hamming(string s, string t) {
  4.     int pom=0;
  5.     for(int i=0; i<s.size();i++)
  6.     {
  7.         if(s[i]!=t[i])
  8.             pom++;
  9.     }
  10.     return pom;
  11. }
  12. int main()
  13. {
  14.     cout<<hamming("CAGGTT", "CAGGTT")<<endl;
  15.     cout<<hamming("CAGGCTACTACCGGTAT", "CATCGTAATGCAGGGCT");
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement