WnSOJ
Home
Problems
Jobs
FAQ
API
Swagger UI
ReDoc
Login
Register
Statement
Editorial
Submissions
Editorial
Find the number of characters on same positions that are not equal.
Author's Solution
Show Solution
Theme:
default
darcula
eclipse
GNU C++17
Copy Code
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int answer = 0; for(int i = 0; i < s.size(); ++i) { if(s[i] != t[i]) ++answer; } cout << answer << endl; return 0; }