fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int n ; cin>>n ;
  8. for(int i = 1 ; i<=n; i++){
  9. int digit = (2*(i-1)+1)%10;
  10. for(int j =1;j<=n;j++){
  11. cout<<digit;
  12. digit = (digit+2) % 10;
  13. }
  14. cout<<endl;
  15. }
  16.  
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 5312KB
stdin
5
stdout
13579
35791
57913
79135
91357