-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrincipal.cpp
More file actions
118 lines (95 loc) · 2.53 KB
/
Principal.cpp
File metadata and controls
118 lines (95 loc) · 2.53 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <new>
int comparacoes=0;
int movimentacoes=0;
#include "MergeSort.h"
#include "QuickSort.h"
#include "ShellSort.h"
#include "dados.h"
void menu();
void encaminhaOpcaoDoMenu(char op);
void encaminhaOpcaoGeral(char op, char tipo[]);
void menuGeralVetor(char tipoVetor[]);
int main(){
menu();
}
void menu(){
char opcao;
do{
puts("------Performance-de-Ordenacao------");
puts("1 - Ordernar numeros digitados");
puts("2 - Ordenar vetores randomicos");
puts("3 - Ordenar vetores semi orndenados");
puts("4 - Ordenar vetores ja ordenado");
puts("0 - Sair");
scanf("%c",&opcao);
encaminhaOpcaoDoMenu(opcao);
system("cls||clear");
}while(opcao!='0');
puts("Saida do sistema\n");
system("pause");
}
void encaminhaOpcaoDoMenu(char op){
switch (op){
case '1':
system("cls||clear");
lerEntradaUser();
puts("");
system("pause");
break;
case '2':
system("cls||clear");
menuGeralVetor("randomicos");
puts("");
break;
case '3':
system("cls||clear");
menuGeralVetor("semi ordenados");
puts("");
break;
case '4':
system("cls||clear");
menuGeralVetor("ordenados");
puts("");
break;
}
}
void menuGeralVetor(char tipoVetor[]){
char op;
do{
system("cls||clear");
printf("1 - Dados %s (20000 inteiros)",tipoVetor);
printf("\n2 - Dados %s (60000 inteiros)",tipoVetor);
printf("\n3 - Dados %s (120000 inteiros)",tipoVetor);
printf("\n4 - Ordenar N quantidade de numeros %s",tipoVetor);
puts("\n0 - Voltar");
scanf("%c",&op);
encaminhaOpcaoGeral(op,tipoVetor);
}while(op!='0');
}
void encaminhaOpcaoGeral(char op, char tipo[]){
switch (op){
case '1':
system("cls");
geraVetor(vetorInt,20000,tipo);
system("pause");
break;
case '2':
system("cls");
geraVetor(vetorInt,60000,tipo);
system("pause");
break;
case '3':
system("cls");
geraVetor(vetorInt,120000,tipo);
system("pause");
break;
case '4':
system("cls");
entradaUserRandom(tipo);
system("pause");
break;
}
}