do-while巢狀迴圈 數字三角形矩陣
#include#include #include using namespace std; int main(int argc, char *argv[]) { int outer = 1; do { int inner = 1; do { cout << setw(3) << inner; } while (inner++ <= 5-outer); cout << endl; } while (outer++ <= 4); system("PAUSE"); return EXIT_SUCCESS; }