Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
1.4 kB
1
Indexable
Never
//классная работа
#include <iostream>
#include <cmath>
#include <windows.h>
using namespace std;
int main()
{
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    int a = 0;
    int i = 0;
    SetConsoleTextAttribute(hConsole, 22);
    cout << "   ";
    SetConsoleTextAttribute(hConsole, 37);
    while (i < 10){
        i++;
        cout << "|";
        if (i == 10){
            cout << " " << i << "";
        }
        else{
            cout << " " << i << " ";
        }
    }
    cout << "|\n";
    i = 0;
    while (a < 10){
        a++;
        SetConsoleTextAttribute(hConsole, 37);
        if (a < 10){
            cout << " " << a << " ";
        }
        else{
            cout << " " << a;
        }
        while (i < 10)
{
            i++;
            SetConsoleTextAttribute(hConsole, 56);
            cout << "|";
            if (a == i){
                SetConsoleTextAttribute(hConsole, 25);
            }
            if (a * i / 10 > 0 && a*i < 100){
                cout << " "<< a * i ;
            }
            if (a * i / 10 == 0 && a*i < 100){
                cout << " " << a * i << " ";
            }
            if (a * i >= 100){
                cout << a * i;
            }
        }
        cout << "|\n";
        SetConsoleTextAttribute(hConsole, 0);
        i = 0;
    }
    return 0;
}
Leave a Comment