Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication10.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include "locale"
- #include "iostream"
- #include "windows.h"
- #include "iomanip"
- using namespace std;
- int a[100][100];
- int c;
- int z = 0;
- int i = 0;
- int k = 0;
- void set_color(int attr)
- {
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); // Получение дескриптора устройства стандартного вывода
- SetConsoleTextAttribute(hConsole, attr);
- }
- int main()
- {
- setlocale(LC_ALL, "rus");
- cout << "Введите размер квадратной таблицы таблицы ";
- cin >> c;
- for (i = 1; i <= c + 1; i++)
- for (int k = 1; k <= c + 1; k++)
- a[i][k] = (i) * (k) - 1;
- a[1][1] = 0;
- for (i = 2; i <= c + 1; i++)
- for (int k = 2; k <= c + 1; k++)
- set_color(0x0f);
- a[i][k] = (i - 1) * (k - 1);
- for (i = 1; i <= c + 1; i++)
- {
- cout << "\n";
- for (int k = 1; k <= c + 1; k++)
- {
- cout << setw(4) << a[i][k];
- }
- }
- cout << "\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement