#include < iostream >
#include < cmath >
using namespace std;
int convert(string s)
{
int x=0, n=s.size();
for(int i=0; i<n; i++)
x+=((s[i]-48) * pow(10, n-1-i));
return x;
}
int main()
{
string x; cin >> x;
cout << convert(x);
return 0;
}
Mọi người giải đáp giúp em/mình với! Tại sao khi độ dài xâu là chẵn thì kết quả đúng, là lẻ thì lại sai.