Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created September 6, 2019 11:36
Show Gist options
  • Save surinoel/eed575f19b2b29b4abd8cfae33e5ac35 to your computer and use it in GitHub Desktop.
Save surinoel/eed575f19b2b29b4abd8cfae33e5ac35 to your computer and use it in GitHub Desktop.
#include <string>
#include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string a, b;
cin >> a >> b;
int ans = 0;
if (a.length() == b.length()) {
for (int i = 0; i < a.length(); i++) {
if (a[i] == b[i]) {
if (a[i] == '8') {
ans += 1;
}
}
else {
break;
}
}
}
cout << ans << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment