Guest User

Untitled

a guest
Jan 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3.  
  4. void Multiply(int x, int y);
  5.  
  6.  
  7.  
  8.  
  9. void Multiply(int a, int b)
  10. {
  11. int result = a * b;
  12.  
  13. if (result < 10)
  14. std::cout << "0";
  15.  
  16. std::cout << result << " ";
  17. }
  18.  
  19.  
  20. void PrintRow(int row_number, int columns_count)
  21.  
  22. { //begin
  23. for (int i = 1; i < columns_count; i++)
  24. {
  25. Multiply(row_number, i);
  26. }
  27.  
  28. std::cout << '\n';
  29. }//end
  30.  
  31.  
  32. void PrintTable(int grid_size) {
  33. for (int i = 1; i < grid_size; i++)
  34. {
  35. PrintRow(i, grid_size);
  36. }
  37. }
  38.  
  39.  
  40.  
  41.  
  42. int main()
  43. {
  44. PrintTable(10);
  45.  
  46. std::getchar();
  47. }
Add Comment
Please, Sign In to add comment