Glenpl

Untitled

Nov 14th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <iomanip>
  4. using namespace std;
  5. HANDLE uchwyt = GetStdHandle(STD_OUTPUT_HANDLE);
  6. #define kolor SetConsoleTextAttribute(uchwyt,
  7. int main()
  8. {
  9.     kolor 8);
  10.     cout<<"*";
  11.     kolor 6);
  12.     cout<< " |";
  13.     cout<<"  "<<setw(2)<<  "1";
  14.     for(int i=2; i<16; i++)
  15.     cout<<" | "<<setw(2)<<  i;
  16.     cout<<" |"<<endl;
  17.     for(int i=1; i<80; i++)cout<<"-";
  18.         cout<<endl;
  19.         for(int i=1; i<11; i++)
  20.         {
  21.             kolor 6);
  22.             cout<<setw(1)<<i;
  23.             if(i==10)cout << "| ";
  24.                 else cout<<" | ";
  25.                     kolor 7);
  26.                     for(int j=1; j<16; j++)
  27.                     {
  28.                         if((i*j) < 100)
  29.                             {
  30.                                 cout<<setw(3)<<i*j;
  31.                                 kolor 6);
  32.                                 cout<<" |";
  33.                             }
  34.                             else
  35.                             {
  36.                                 cout << setw(4)<<i*j;
  37.                                 kolor 6);
  38.                                 cout<<"|";
  39.                             }
  40.                             kolor 7);
  41.                         }
  42.                 cout <<endl;
  43.                 kolor 6);
  44.                 for(int i=1; i<80; i++)
  45.                 cout<<"-";
  46.                 kolor 7);
  47.                 if(i<10)cout<<endl;
  48.                 }
  49. cin.get();
  50. }
Advertisement
Add Comment
Please, Sign In to add comment