Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- int giongnhau(string s1, string s2) {
- int dem = 0;
- for (int i = 0; i < s1.size(); i++) {
- for (int j = 0; j < s2.size(); j++) {
- if (s1[i] == s2[j]) {
- dem = dem + 1;
- }
- }
- }
- return dem;
- }
- void main() {
- string s1, s2;
- cout << giongnhau("abcde", "abee");
- system("pause>null");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement