Advertisement
Guest User

6475

a guest
Dec 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<iostream>
  2.    #include<iomanip>
  3.    using namespace std;
  4.    int main()
  5.    {
  6.    int i,j;    
  7.    cout<<"     "<<1;//5 space chars
  8.  
  9.    for(i = 2;i <= 10;++i)
  10.        cout<<"    "<<i;//4 space chars
  11.  
  12.    cout<<endl;
  13.    cout<<"   ----|";
  14.  
  15.    for(i = 2;i <= 10;++i)
  16.        cout<<"----|";
  17.  
  18.    cout<<endl;
  19.  
  20.    for(i = 1;i <= 10;++i)
  21.    {
  22.        cout<<setw(2)<<i<<"|";
  23.  
  24.        for(j = 1;j <= 10;++j)
  25.           cout<<setw(4)<<j*i<<"|";
  26.  
  27.        cout<<endl;
  28.        cout<<" -|----";
  29.  
  30.        for(j = 2;j <= 9;++j)
  31.           cout<<"|----";
  32.  
  33.        cout<<"|----|";
  34.        cout<<endl;
  35.  
  36.    }
  37.    return 0;
  38.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement