Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 27th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. input, output and \n's
  2. string test;
  3. string original;
  4.  
  5. while (getline(fin,test))
  6.     original += test;
  7.        
  8. int len = answer.length();
  9. answer = cleanUp(answer);
  10. while (len > 0){
  11.     string s3 = answer.substr(0,80);
  12.     answer.erase(0,80);
  13.     fout << s3 << endl;
  14.     len -= 80;
  15. }
  16.        
  17. for (int i=1; i<total_chars; i++)
  18.     for (n=1; n<min(i, total_chars-i); n++)
  19.         if (array[i+n] != array[i-n])
  20.             // Candidate palindrome is from array[i-n+1] to array[i+n-1]