#include<iostream> #include<string.h> using namespace std;
int main() { char str[] = "viikk"; int rep[26] = {0}; int i, len = strlen(str); int num_odd=0; for(i=0; i<len; i++) rep[(str[i]-'a')]++; for(i=0; i<26; i++) { if((rep[i] != 0) && (rep[i]%2 ==1)) { num_odd++; if(num_odd>1) { cout<<"Can not be a pallindrome."; return 0; } } } cout<<"A pallindrome can be formed."; return 0; } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.