
find order arrangements in c + + program
good here I leave you a program on arrangements
this is the source code
/ / Deberarreglo.cpp: main project file.
# Include "stdafx.h"
using namespace System;
# Include
using std:: cin;
using std:: court;
using std:: endl;
# Include
using std:: setw;
void proceed ();
int title ();
void options (int);
void enter ();
ingresar1 void ();
void display (int [], int);
int entry ();
void search (int [], int, int, int);
ingreso2 int ();
void sort (int [], int);
int op, valbusca, number, found;
const int s size = 7;
int main (array
{
continue ();
Console:: Read ();
return 0;
}
void continue ()
{
do
{
title ();
options (op);
}
while (op! = 3);
}
int title ()
{
court <<"nntOPCIONES - ARREGLOSn"
court <<"t1. Change vector elements if they are equal to a argumenton"
court <<"t2. Sort Ascending a vector method secuencialn"
court <<"t3. Finn"
court <<"tDigite option:";
cin>> op;
return op;
}
void options (int option)
{
switch (option)
{
case 1:
enter ();
break;
case 2:
ingresar1 ();
break;
case 3:
court <
default:
court <<"nOptions WRONG"
}
}
void enter ()
{
int array [s size];
court <<"nPlease enter: n";
for (int j = 0, j
court <<"n [" <
}
display (array, si ze);
income ();
search (array, s size, valbusca, number);
}
int entry ()
{
court <<"nnIngrese value to search:";
cin>> valbusca;
valbusca return;
}
void search (int a [], int elem, int VALB, int num)
{
int help = 0, position;
for (int i = 0; i
if (a == VALB)
{
found = a;
position = i;
help = 1;
court <<"nnel ELEMENT:" <
a = number;
court <<"nnNuevo Agreement";
for (int r = 0, r
}
if (aid == 0)
court <<"nElement" <
ingreso2 int ()
{
court <<"nPlease enter new value for the position:"
cin>> number;
return number;
}
ingresar1 void ()
{
int array1 [s size];
court <<"nPlease enter: n";
for (int j = 0, j
court <<"n [" <
}
display (array1, si ze);
order (array1, si ze);
court <<"nnArreglo Order";
display (array1, si ze);
}
void sort (int c [], int el)
{
int max, aux;
for (int i = 0; i
max = i;
for (int j = i +1, j
aux = c [max];
c [max] = c;
c = aux;
}
}
void display (int b [], int cinnamon)
{
court <<"nnArreglo:";
for (int k = 0, k
No hay comentarios:
Publicar un comentario