12345678910111213141516171819202122
#include <iostream> using namespace std; int main() { int length = 10; int i; for (i = 0; i < length; ++i) { cout << i << endl; } cout << endl << endl; i = 0; while (i < length) { cout << i << endl; ++i; } }