12345678910111213141516171819202122
#include <iostream> #include <ctime> #include <cstdlib> #include <iomanip> using namespace std; void main() { int a[4] = { 10, 20, 30, 40 }; int i = 0; int j = 4; while (i++ < 4) { j = i; cout << a[i] << endl; while (j-->0) cout << i << " "; } system("pause"); }
while( i++ < 4 )
while( --j > 0 )