-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.h
96 lines (72 loc) · 2.76 KB
/
tasks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
ß ÷åñòíî î÷åíü äîëãî ïèñàë ýòî ãîâíî, ïîýòîìó åñëè âû ñïàëèòåñü, áóäåò ãðóñòíî
Âîçüìèòå âñïîìîãàòåëüíûå ôóíêöèè (áåç main â íàçâàíèè) è ïèøèòå ñâîè çàäà÷è ñ íèìè (÷òîáû íå ïàëèòñÿ)
Êàê þçàòü â ñâîèõ ïðîåêòàõ:
1. Êîïèðóåòå tasks.h (ëó÷øå ïåðåèìåíóéòå)
2. Óäàëÿåòå îò òóäà íåíóæíûå ôóíêöèè (÷òîáû íå ïàëèòñÿ)
3. Âêëþ÷àåòå â ÊÀÆÄÛÉ ôàéë ñâîåãî êîäà
4. Profit
*/
#pragma once
#pragma warning(disable : 4996)
#define _CRT_SECURE_NO_WARNINGS
#define e 2.713
#define pi 3.1415
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
using namespace std;
// ----- ×åòâåðòûé ñåìèíàð -----
void main_4();
double I1(int a, int b, int N); //Íèæíèå ïðÿìîóãîëüíèêè
double I2(int a, int b, int N); //Òðàïåöèè
double I3(int a, int b, int N); //Âåðõíèå ïðÿìîóãîëüíèêè
double I4(int a, int b, int N); //Ñðåäíèå ïðÿìîóãîëüíèêè
double I5(int a, int b, int N); //Ìåòîä Ñèìïñîíà
double f(double x);
// ----- Ïÿòûé ñåìèíàð -----
void main_52();
void main_54();
// ----- Øåñòîé ñåìèíàð -----
void main_615();
void main_67();
void main_62();
// Âåêòîð (äâóìåðíûé äèíàìè÷åñêèé ìàññèâ)
/*
Ñ ÌÀÑÑÈÂÀÌÈ, ÎÁÚßÂËÅÍÍÛÌÈ ÏÎ ÒÈÏÓ double** array ÐÀÁÎÒÀÒÜ ÍÅ ÁÓÄÅÒ
ÎÁÚßÂËßÉÒÅ ÌÀÑÑÈÂÛ Â ÂÈÄÅ double* array
*/
void push_back(double* array, size_t& size, size_t& capacity, const double& element); //Äîáàâëåíèå ýëåìåíòà â êîíåö ìàññèâà
void pop_back(double* array, size_t& size);
void insert(double* array, size_t& size, size_t& capacity, size_t& ind, const double& element);
double at(double* array, size_t ind);
void resize(double* array, size_t& size, size_t& capacity, size_t new_size);
void sort(double* array, size_t size);
void destruct(double* array);
// Äâóìåðíàÿ ìàòðèöà (äëÿ 6.15 è åìó ïîäîáíûõ)
void add_column(double* array, size_t& size, size_t& columns, size_t rows, size_t capacity);
void add_row(double* array, size_t& size, size_t columns, size_t& rows, size_t capacity);
void print(double* array, size_t size, size_t& columns);
// Ñòýê (Äèíàìè÷åñêèé îäíîìåðíûé ìàññèâ)
void AddMemmory(int* A, int* N);
void printarr(int* Arr, int N);
void push(int x, int* Arr, int* N, int* index);
void printall(int* Arr, int N, int index);
int pop(int* Arr, int* N, int* index);
// ----- Ñåäüìîé ñåìèíàð -----
void main_73();
void main_78();
// ----- Âîñüìîé ñåìèíàð -----
void main_810();
void main_811();
// ----- Äåâÿòûé ñåìèíàð -----
void main_98();
void main_99();
// ----- Ïîëåçíûå ôóíêöèè -----
bool is_prime(int number); //Ïðîñòîå ÷èñëî èëè íåò
void print_m(int** m, int n); //Âûâîä äâóìåðíîãî äèíàìè÷åñêîãî ìàññèâà
int** input_m(int** a, int n); //Ââîä äâóìåðíîãî äèíàìè÷åñêîãî ìàññèâà
int write_f(char* s, FILE* output_file); //Äîáàâëåíèå â êîíåö ôàéëà
FILE* open_f(const char* path, const char* type); //Îòêðûòèå ôàéëà
int* read_f_int(const char* path); //Ñ÷èòûâàíèå âñåõ çíà÷åíèé è âûâîä ìàññèâà int