Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9. ifstream a;
  10. ofstream b;
  11. string first,twice;
  12. int kol = -2;
  13. a.open("keyboard.in");
  14. a>>first>>twice;
  15. a.close();
  16. int ch [first.length()];
  17. for(int i = 0;i<first.length();i++){
  18. if(first[i]!=twice[i]&&ch[i-1]!=1){
  19. ch[i]=1;
  20. kol++;
  21. }
  22. }
  23. b.open("keyboard.out");
  24. b<<kol;
  25. b<<endl;
  26. b.close();
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement