Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Ophui.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- #include <ctime>
- #include <iomanip>
- double ** mas;
- int w, h;
- using std::cout;
- using std::cin;
- using std::endl;
- using std::setw;
- void create()
- {
- system("cls");
- cout << "Введи ширину: ";
- cin >> w;
- cout << "Введи высоту: ";
- cin >> h;
- mas = new double*[w];
- for (int i = 0; i < w; i++)
- mas[i] = new double[h];
- for (int i = 0; i < w; i++)
- for (int j = 0; j < h; j++)
- mas[i][j] = (double)(rand() % (1000 - (-1000) + 1) + (-1000)) / 100;
- ;
- cout << "Готово!";
- _getch();
- }
- void out()
- {
- system("cls");
- for (int i = 0; i < w; i++)
- {
- for (int j = 0; j < h; j++)
- cout << setw(5) << mas[i][j];
- cout << endl;
- }
- _getch();
- }
- void work()
- {
- }
- int main()
- {
- srand(time(NULL));
- setlocale(LC_ALL, "");
- char choice;
- do
- {
- system("cls");
- cout << "\tМеню программы 'Оп - хуй' " << endl ;
- cout << "Выбери пункт, оп(нажми клавишу, сука): " << endl;
- cout << "1: Создание массива\n";
- cout << "2: Вывод массива\n";
- cout << "3: Обработка массива\n";
- cout << "4: Съебаться нахуй\n";
- choice = _getch();
- switch (choice)
- {
- case '1':
- create();
- break;
- case '2':
- out();
- break;
- case '3':
- work();
- break;
- default:
- break;
- }
- } while (choice != '4');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement