Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- void showResult(int, int, int);
- void showTopContent(int, int);
- void showTable(int, int, int);
- int main()
- {
- int number = 0;
- cout << "Enter your number: ";
- cin >> number;
- showResult(10, 10, number);
- return 0;
- }
- void showResult(int column, int row, int number){
- showTopContent(row, column);
- showTable(column, row, number);
- }
- void showTopContent(int row, int n){
- cout << "# |";
- for(int i = 0; i < n; i++){
- cout << setw(5) << i;
- }
- string divider = "===";
- for(int i = 0; i < row * 5; i++){
- divider += "=";
- }
- cout << endl << divider << endl;
- }
- void showTable(int column, int row, int number){
- for(int i = 0; i < row; i++){
- cout << i << " |";
- for(int j = 0; j < column; j++){
- cout << setw(5) <<((i * 10) + j) * number;
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement