Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(void) {
  7. ios_base::sync_with_stdio(false);
  8. cin.tie(nullptr);
  9.  
  10. string a, b;
  11. cin >> a >> b;
  12. int ans = 0;
  13. if (a.length() == b.length()) {
  14. for (int i = 0; i < a.length(); i++) {
  15. if (a[i] == b[i]) {
  16. if (a[i] == '8') {
  17. ans += 1;
  18. }
  19. }
  20. else {
  21. break;
  22. }
  23. }
  24. }
  25. cout << ans << '\n';
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement