Please can someone tell me what's wrong with my code on spy life
#include <iostream> using namespace std; int main() { string sentence; string new_sentence; int i, j = 0, len; getline(cin, sentence); len = sentence.length(); char sentences [len]; for(int i = 0; i <= len; i++){ if((sentence[i] >= 'a' && sentence[i] <= 'z') || (sentence[i] >= 'A' && sentence[i] <= 'Z') || sentence[i] == ' '){ sentences[j] = sentence[i]; j++; } } new_sentence = sentences; for(i = 0, j = new_sentence.length()-1; i < (new_sentence.length()/2); ++i, --j){ int temp; temp = new_sentence[i]; new_sentence[i] = new_sentence[j]; new_sentence[j] = temp; } for(i = 0; i < new_sentence.length()+1; i++){ cout << new_sentence[i]; } return 0; }