for loop - asterisk tree looping in c++ -


how flip output around smallest largest?

#include <iostream> using namespace std; int main (){     int m, n;     (m=0; m<10; m++) {         (n=0; n<m; n++) cout << " ";         (n=0; n<(19-2*m); n++) cout << "*";         (n=0; n<m; n++) cout << " ";         cout << endl;     }     return 0; } 

just flip it.

#include <iostream> using namespace std; int main (){     int m, n;     (m=9; m>=0; m--) {         (n=0; n<m; n++) cout << " ";         (n=0; n<(19-2*m); n++) cout << "*";         (n=0; n<m; n++) cout << " ";         cout << endl;     }     return 0; } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -