0

Help me with this if you don't mind

#include <iostream> #include <vector> #include <numeric> using namespace std; class process{ public: void start(){ string a; string result; cin >> a; int b = 0; int siz = 0; int word = 0; string n; shift.push_back(a); for(int i = 0; i<shift[word].size(); i++){ letters.push_back(a.at(b)); copy.push_back(a.at(b)); b++; } do{ letters.insert(letters.end(), copy[siz]); for(int i = 1; i<letters.size(); i++){ n =+ letters[i]; } cout << n <<"\n"; siz++; } while(siz<b); } private: vector<string> shift; vector<char> letters; vector<char> copy; }; int main(){ process ok; ok.start(); }

30th Jul 2018, 5:16 PM
Sviatyk Sapovsky
Sviatyk Sapovsky - avatar
5 Respuestas
+ 3
What is this code supposed to do? what is the expected final result? try first to change "n =+ letters[i];" into "n += letters[i];" : )
30th Jul 2018, 6:35 PM
Ipang
+ 1
lpang, thanks a lot, i missed that😁 (here is quest by the way: https://www.sololearn.com/learn/9885/?ref=app)
30th Jul 2018, 8:52 PM
Sviatyk Sapovsky
Sviatyk Sapovsky - avatar
+ 1
yoohoo gonna post my final work; #include <iostream> #include <vector> #include <numeric> using namespace std; class process{ public: void start(){ string a; string result; string n; int c = 1; int b = 0; int siz = 0; int word = 0; cin >> a; shift.push_back(a); for(int i = 0; i<shift[word].size(); i++){ letters.push_back(a.at(b)); copy.push_back(a.at(b)); b++; } do{ letters.insert(letters.end(), copy[siz]); for(int i = c; i<letters.size(); i++){ n += letters[i]; } c++; cout << n <<", "; siz++; n.clear(); } while(siz<copy.size()); } private: vector<string> shift; vector<char> letters; vector<char> copy; }; int main(){ process ok; ok.start(); }
31st Jul 2018, 7:17 AM
Sviatyk Sapovsky
Sviatyk Sapovsky - avatar
0
it's so complicated, any efforts appreciated🤗
30th Jul 2018, 5:21 PM
Sviatyk Sapovsky
Sviatyk Sapovsky - avatar
0
Good job! congratulations and good luck! : )
31st Jul 2018, 7:22 AM
Ipang