I have a code with string
, and I need to get an output of every second inputted character.
I don't understand how to do that at all.
Example: If you input 123 56
, output should be 135
.
Please, help me to do that.
#include<iostream>
using namespace std;
int main(){
string str;
cout<<"Enter a String:";
getline(cin,str);
cout<<"You entered: ";
cout<<str<<endl;
// What should I write here?.
}