Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void out(int n, int x)
  5. {
  6. if(n == 0)
  7. {
  8. return;
  9. }
  10.  
  11. out(n / x, x);
  12. cout << n % x;
  13. }
  14.  
  15. int main()
  16. {
  17. int K;
  18. cin >> K;
  19.  
  20. for(int i = 0; i < K - 1; ++i)
  21. {
  22. cout << i + 1;
  23. for(int j = 1, n; j < K - 1; ++j)
  24. {
  25. cout << " ";
  26. out((i + 1) * (j + 1), K);
  27. }
  28. cout << endl;
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement