fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. const unsigned patternSize = 10;
  7. const unsigned outputLen = 25 ;
  8.  
  9. int pattern[patternSize] = {0,1,2,3,4,5,6,7,8,9};
  10. for(int i=0; i<outputLen; i++)
  11. cout << pattern[i%patternSize] << ' ' ;
  12.  
  13. cout << endl;
  14. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4