|
|
back to boardI got Compilation Error in PALINDROME Problem....HELP!!!!! Here's my code that runs well on my PC. #include<iostream> #include<algorithm> using namespace std; main() { string txt; string txtRev; string tmp; int i; int com; while(cin>>txt){ i=0; do{ for (int n=i+2;n<txt.length();n++){ tmp=txt.substr(i,n); txtRev=tmp; reverse(txtRev.begin(),txtRev.end()); com= txtRev.compare(tmp); if (com==0) break; } i++; }while (com!=0); cout<< tmp <<" " <<endl; } } Re: I got Compilation Error in PALINDROME Problem....HELP!!!!! #include <string> |
|
|