+ 2
The spy life question on sololearn i am not getting the correct answer please correct my code
#include <bits/stdc++.h> using namespace std; int main(){ string s; string temp = " "; getline(cin,s); for(int i=0;i<s.length();i++){ if(s[i]>=65 && s[i]<=90 || s[i]>=97 && s[i]<=122 ||s[i]==32){ temp += s[i]; } } for(int i=temp.length();i>=0;i--){ cout<<temp[i]; } return 0; }
3 Answers
+ 9
Manthan Ambekar if case, u haven't closed them properly...and second for loop shud start from length()-1
https://code.sololearn.com/cyxKTXVzszBe/?ref=app
+ 2
Thanks Chaithra Gowdađ and @swim