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