+ 1

Want to print CHENGATSERING many times.

18th Jul 2016, 1:44 AM
Chenga Tsering
Chenga Tsering - avatar
2 Respostas
+ 1
This is quite simple, you can do it on your own as telling from your achievements, you already completed five lessons here at SoloLearn C++.
18th Jul 2016, 1:51 AM
Stefan
Stefan - avatar
0
This should do. #include <iostream> #include <string> int main() {     std::string str = "CHENGATSERING";     int strLength = str.length();     for (int i = strLength - 1; strLength >= 0; i--)     {         std::cout << str << std::endl;         str.erase(i);     } }
18th Jul 2016, 1:58 AM
Cohen Creber
Cohen Creber - avatar