The output code is stuck!
#include <iostream> #include <string> #include <sstream> using namespace std; string isAutomorphic(){ string a; int num; int is; int c; string f; string r; string x; stringstream stream; cin >> a; cout << "Your number: " << a << endl; stream << a; stream >> num; int b = num * num; cout << "Squared: " << b << endl; stream.str(""); stream << b; stream >> x; int z = num; is = x.find_last_of(z); stream.str(""); stream << num; stream >> r; if (num != (r.size() - (r.size() - is))){ f = "No, it is not an automorphic number."; } else if (num == (r.size() - (r.size() - is))){ f = "Yes, it is an automorphic number."; } stream.str(""); return f; } int main() { cout << isAutomorphic() << endl; return 0; } The code is stuck on “No, it is not an automorphic number”. https://code.sololearn.com/c8q1auNCtlWZ/?ref=app