There is such a program:
#include <bits/stdc++.h> using std::cout; using std::endl; using std::string; int main() { const int n = 15; for(int i=0;i<n;i++) cout << string(n/2-1-i, ' ') << string(i*2+1, 42) << endl; return 0; } But while working, she throws an exception. Question: what are the ways to get rid of it or write a program differently?
* *** ***** ******* ********* *********** ************* terminate called after throwing an instance of 'std::length_error' what(): basic_string::_S_create