SlideShare a Scribd company logo
1 of 13
//#include <stdafx.h><br />#include <conio.h> <br />#include <windows.h><br />#include <string.h><br />#include <iostream.h> <br />//using namespace std;<br />#define cnt_max_string 10<br />#define cnt_char_ver 'x'<br />#define cnt_char_hor '-'<br />#define cnt_char_marco '*'<br />#define cnt_char_limpiar ' '<br />#define cnt_col_pant 5<br />#define cnt_fil_pant 2<br />#define cnt_col_mat 20<br />#define cnt_fil_mat 20<br />#define cnt_vec 20<br />#define cnt_num_campos 5<br />int VOPCION;<br />int VLV;<br />int Vfilas,Vcolumnas,edad;<br />int Vcodigo;<br />int Vbusqueda;<br />int Vfila_B;<br />struct Tpersona{<br />int codigo;<br />char nombres[cnt_max_string];<br />char direccion[cnt_max_string];<br />char telefono[cnt_max_string];<br />int edad;<br />}Vec_per[cnt_vec];<br />struct Tpersona Mat_per [cnt_fil_mat] [cnt_col_mat];<br />/*void gotoxy(int x, int y)<br />{<br /> COORD coord;<br /> coord.X = x;<br /> coord.Y = y;<br /> SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);<br />} */<br />void Linea (char Ptipo,char Pcaracter,int Pfil, int Pcol,int Pfili,int Pcoli)<br />{<br />  int vsm,vsmi,vsmf; <br />  int vsl,vsli,vslf; <br />  int vsinc;<br />  switch(Ptipo)<br />   {<br />    case 'V':<br />     vsli=(cnt_col_pant-1); vslf=((cnt_max_string*Pcol)+vsli+Pcol);<br />     vsmi=(cnt_fil_pant-1); vsmf=(((cnt_num_campos+1)*Pfil))+1;<br />     vsinc=cnt_max_string+1;<br /> break;<br />    case 'H':<br />     vsli=(cnt_fil_pant-1); vslf=(((cnt_num_campos+1)*Pfil))+1;<br />     vsmi=(cnt_col_pant-1); vsmf=((cnt_max_string*Pcol)+vsmi+Pcol);<br /> vsinc=cnt_num_campos+1;<br />   break;<br />    case 'X':<br />     vsli=Pcoli; vslf=Pcol; vsmi=Pfili; vsmf=Pfil; vsinc=Pcol-Pcoli;<br />   break;<br />    case 'Y':<br />     vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=Pfil-Pfili;<br />   break;<br />    case 'L':<br />     vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=1;<br />   break;<br />    }<br />   <br />  for (vsl=vsli;vsl<=vslf;vsl+=vsinc)<br />   {<br />    for (vsm=vsmi;vsm<=vsmf;vsm++)<br />      {<br />       switch(Ptipo)<br />         {<br />       case 'V': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br />           case 'H': gotoxy(vsm,vsl); cout<< Pcaracter; break;<br />           case 'X': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br />           case 'Y': gotoxy(vsm,vsl); cout<< Pcaracter; break;<br />           case 'L': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br />          }<br />      }<br />   }<br />};<br />void Matriz (int Pfil, int Pcol, char Popcion)<br /> { <br />  int vsy=0;<br />  for (int vsf = 0 ; vsf < Pfil ; vsf++)<br />   {<br />    int vsx=0;<br />for (int vsc = 0 ; vsc < Pcol ; vsc++)<br />      {<br />       switch(Popcion)<br />    {<br />         case 'I':<br />              gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+0));<br />               cin>> Mat_per[vsf] [vsc].codigo;<br />              gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+1));<br />               cin>> Mat_per[vsf] [vsc].nombres;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+2));<br />                cin>> Mat_per[vsf] [vsc].direccion;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+3));<br />                cin>> Mat_per[vsf] [vsc].telefono;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+4));<br />                 cin>> Mat_per[vsf] [vsc].edad;<br />         break;<br />        case 'P':<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+0));<br />                cout<< Mat_per[vsf] [vsc].codigo;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+1));<br />                cout<< Mat_per[vsf] [vsc].nombres;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+2));<br />                cout<< Mat_per[vsf] [vsc].direccion;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+3));  <br />                cout<< Mat_per[vsf] [vsc].telefono;<br />               gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+4));<br />                cout<< Mat_per[vsf] [vsc].edad;<br />          break;<br />    }   // fin del switch<br />   vsx+=cnt_max_string+1;<br />   } // fin del for vsc  <br /> vsy+=cnt_num_campos+1;<br />} // fin del for vsf<br />   }// fin del void matriz<br />void Vector (int Plv, char Popcion)<br /> { <br />  int vsy=0;<br />  for (int vsf = 0 ; vsf < Plv ; vsf++)<br />   {<br />      switch(Popcion)<br />    {<br />         case 'I':<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cin>> Vec_per[vsf].codigo;<br />          gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cin>> Vec_per[vsf].nombres;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+2));cin>> Vec_per[vsf].direccion;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+3));cin>> Vec_per[vsf].telefono;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+4));cin>> Vec_per[vsf].edad;<br />          break;<br />        case 'P':<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cout<< Vec_per[vsf].codigo;<br />          gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cout<< Vec_per[vsf].nombres;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+2));cout<< Vec_per[vsf].direccion;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+3));cout<< Vec_per[vsf].telefono;<br />    gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+4));cout<< Vec_per[vsf].edad;<br />          break;<br />       case 'B':<br />       if (Vec_per[vsf].codigo == Vcodigo)<br />   {<br />Vbusqueda=1;    <br />                  Vfila_B=vsf;<br />   }<br />           break;<br />    }   // fin del switch<br />   vsy+=cnt_num_campos+1;<br />} // fin del for vsf<br />   }// fin del void vector<br />void menu()<br />{ <br />//    system(quot;
clsquot;
);<br />clrscr();<br />int vsbandera;<br />char vseliminar;<br />vsbandera=1;<br />    while (vsbandera!=0)<br />    { <br />    // system(quot;
clsquot;
);<br />    clrscr();<br />     //Linea ('L',cnt_char_limpiar,24,79,0,0);<br /> Linea ('X',cnt_char_marco,23,79,0,0);<br /> Linea ('Y',cnt_char_marco, 23, 79,0,0);<br />       gotoxy(5,5);<br />       cout<< quot;
 Programa ejemplo del uso de estructuras con vectores y matrices quot;
; <br />       gotoxy(5,6);<br />       cout<< quot;
**************************************************************quot;
; <br />       gotoxy(5,7); cout<< quot;
1: Ingreso de MATRIZ DE (N x N) quot;
; <br />       gotoxy(5,8); cout<< quot;
2: Reporte de MATRIZ DE (N x N) quot;
; <br />       gotoxy(5,9); cout<< quot;
3: Ingreso de VECTOR DE (N) quot;
; <br />       gotoxy(5,10);cout<< quot;
4: Reporte de VECTOR DE (N) quot;
; <br />       gotoxy(5,11);cout<< quot;
5: Eliminación de Registr quot;
; <br />       gotoxy(5,12);cout<<quot;
 DIGITE 0 PARA SALIR quot;
;<br />       gotoxy(5,13);<br />       cout<< quot;
**************************************************************quot;
; <br />       gotoxy(5,14);cout<<quot;
Opcion: < >quot;
;<br />       gotoxy(14,14);cin>> VOPCION;<br />     switch (VOPCION)<br />  { <br />   case 1:<br />       // system(quot;
clsquot;
);<br />  clrscr();<br />         Linea ('X',cnt_char_marco,25,79,0,0);<br />   Linea ('Y',cnt_char_marco, 25, 79,0,0);<br />  Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br />  Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br />         gotoxy(cnt_col_pant,cnt_fil_pant);<br />           cout<< quot;
Ingreso datos de una matriz quot;
;<br />    gotoxy(cnt_col_pant,cnt_fil_pant+1);<br />           cout<< quot;
Inserte filas de la matriz : quot;
;<br />    cin>> Vfilas;<br />   gotoxy(cnt_col_pant,cnt_fil_pant+2);<br />          cout<< quot;
Inserte columnas de la matriz: quot;
;<br />   cin>> Vcolumnas;<br />//   system(quot;
clsquot;
);<br />clrscr();<br />   Linea ('V',cnt_char_ver, Vfilas, Vcolumnas,0,0);<br />   Linea ('H',cnt_char_hor, Vfilas, Vcolumnas,0,0);<br />         Matriz(Vfilas, Vcolumnas,'I');<br />   break; <br />      case 2:<br />//   system(quot;
clsquot;
);<br />        clrscr();<br />         Linea ('V',cnt_char_ver, Vfilas, Vcolumnas,0,0);<br />   Linea ('H',cnt_char_hor, Vfilas, Vcolumnas,0,0);<br />         Matriz(Vfilas, Vcolumnas,'P');<br />while (getche() != '');<br />getche();<br />   break;<br /> case 3:<br /> //  system(quot;
clsquot;
);<br /> clrscr();<br />   Linea ('X',cnt_char_marco,25,79,0,0);<br />   Linea ('Y',cnt_char_marco, 25, 79,0,0);<br />   Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br />   Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br />   gotoxy(cnt_col_pant,cnt_fil_pant); <br />           cout<< quot;
Ingreso de datos en un Vector quot;
;<br />    gotoxy(cnt_col_pant,cnt_fil_pant+1); <br />         cout<< quot;
Ingrese Longitud del Vector: quot;
;<br />    cin>>VLV;<br />   //system(quot;
clsquot;
);<br />           clrscr();<br />   Linea ('V',cnt_char_ver, VLV,1,0,0);<br />   Linea ('H',cnt_char_hor, VLV,1,0,0);<br />         Vector (VLV,'I');<br />   break;<br /> case 4:<br />//   system(quot;
clsquot;
);<br />clrscr();<br />   Linea ('V',cnt_char_ver, VLV,1,0,0);<br />         Linea ('H',cnt_char_hor, VLV,1,0,0);<br />         Vector (VLV,'P');<br />while (getche() != '');<br />getche();<br />  break;<br />       case 5:<br /> //  system(quot;
clsquot;
);<br />         clrscr();<br />   Vbusqueda=0;<br />   Linea ('X',cnt_char_marco,25,79,0,0);<br />   Linea ('Y',cnt_char_marco, 25, 79,0,0);<br />   Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br />   Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br />   gotoxy(cnt_col_pant,cnt_fil_pant);   cout<< quot;
Busqueda en un Vector quot;
;<br />    gotoxy(cnt_col_pant,cnt_fil_pant+1); cout<< quot;
Ingrese codigo: quot;
;<br />    cin>>Vcodigo;<br />//         system(quot;
clsquot;
);<br />clrscr();<br />         Linea ('V',cnt_char_ver, VLV,1,0,0);<br />   Linea ('H',cnt_char_hor, VLV,1,0,0);<br />         Vector (VLV,'P');<br />         Vector (VLV,'B');<br />         if (Vbusqueda==1)<br />    {<br />      Linea ('X',cnt_char_marco,cnt_fil_pant+14,60,cnt_fil_pant-1,cnt_col_pant-1);<br />      Linea ('Y',cnt_char_marco, cnt_fil_pant+14,60,cnt_fil_pant-1,cnt_col_pant-1);<br />          gotoxy(cnt_col_pant+15,cnt_fil_pant+3);<br />          cout<< quot;
Desea eliminar el registro S/N : quot;
;<br />          cin>>vseliminar; <br />          switch (vseliminar)<br />       {  <br /> case 's':case 'S':<br />             Vec_per[Vfila_B].codigo=0;<br /> strcpy(Vec_per[Vfila_B].nombres,quot;
quot;
);<br /> strcpy(Vec_per[Vfila_B].direccion,quot;
quot;
);<br /> strcpy(Vec_per[Vfila_B].telefono,quot;
quot;
);<br />             Vec_per[Vfila_B].edad=0;<br />//      system(quot;
clsquot;
);<br />             Linea ('V',cnt_char_ver, VLV,1,0,0);<br /> Linea ('H',cnt_char_hor, VLV,1,0,0);<br />             Vector (VLV,'P');<br />       break;<br />} <br />     }<br />while (getche() != '');<br />getche();<br />  break;<br /> case 0:<br />cout<<quot;
quot;
;<br />cout<< quot;
Pulse cualquier tecla para continuarquot;
;<br />getche();<br />vsbandera=0;<br />       }<br />     }<br />   }<br />void main(void)<br /> {   menu();  }<br />
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi
Mauro yaguachi

More Related Content

What's hot

Lukáš Šabľa - Vim
Lukáš Šabľa - VimLukáš Šabľa - Vim
Lukáš Šabľa - Vim
webelement
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
Jeya Lakshmi
 
Cursor implementation
Cursor implementationCursor implementation
Cursor implementation
vicky201
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
jwjablonski
 
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
Atsushi Tadokoro
 

What's hot (20)

Lukáš Šabľa - Vim
Lukáš Šabľa - VimLukáš Šabľa - Vim
Lukáš Šabľa - Vim
 
SLIME
SLIMESLIME
SLIME
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
Cursor implementation
Cursor implementationCursor implementation
Cursor implementation
 
Lecture05(control structure part ii)
Lecture05(control structure part ii)Lecture05(control structure part ii)
Lecture05(control structure part ii)
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)
 
StewartPlatform_cpp
StewartPlatform_cppStewartPlatform_cpp
StewartPlatform_cpp
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshare
 
What JS? Itself
What JS? ItselfWhat JS? Itself
What JS? Itself
 
Algoritmos ensambladores
Algoritmos ensambladoresAlgoritmos ensambladores
Algoritmos ensambladores
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
Implementation of c string functions
Implementation of c string functionsImplementation of c string functions
Implementation of c string functions
 
Looping in C
Looping in CLooping in C
Looping in C
 
Primer Punto
Primer PuntoPrimer Punto
Primer Punto
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
Loops
LoopsLoops
Loops
 
Ember js meetup treviso liquid-fire
Ember js meetup treviso liquid-fireEmber js meetup treviso liquid-fire
Ember js meetup treviso liquid-fire
 
Matuura cpp
Matuura cppMatuura cpp
Matuura cpp
 
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
 

Viewers also liked (6)

Gotoxy
GotoxyGotoxy
Gotoxy
 
Estructura selectiva doble
Estructura selectiva dobleEstructura selectiva doble
Estructura selectiva doble
 
Estructuras de control
Estructuras de controlEstructuras de control
Estructuras de control
 
Estructura selectiva multiple
Estructura selectiva multipleEstructura selectiva multiple
Estructura selectiva multiple
 
Estructura selectiva simple
Estructura selectiva simpleEstructura selectiva simple
Estructura selectiva simple
 
Programa en C++ ( escriba 3 números y diga cual es el mayor))
Programa en C++ ( escriba 3 números y diga cual es el mayor))Programa en C++ ( escriba 3 números y diga cual es el mayor))
Programa en C++ ( escriba 3 números y diga cual es el mayor))
 

Similar to Mauro yaguachi

Diego vega deber 29 03-11
Diego vega deber 29 03-11Diego vega deber 29 03-11
Diego vega deber 29 03-11
diego
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
Abed Bukhari
 
Cplusplus
CplusplusCplusplus
Cplusplus
dancey
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
Adri Jovin
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
tonvanbart
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
aleks-f
 

Similar to Mauro yaguachi (20)

Diego vega deber 29 03-11
Diego vega deber 29 03-11Diego vega deber 29 03-11
Diego vega deber 29 03-11
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
Boost tour 1_44_0_all
Boost tour 1_44_0_allBoost tour 1_44_0_all
Boost tour 1_44_0_all
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 
Theme verdadeiro
Theme verdadeiroTheme verdadeiro
Theme verdadeiro
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Some examples of the 64-bit code errors
Some examples of the 64-bit code errorsSome examples of the 64-bit code errors
Some examples of the 64-bit code errors
 
Cplusplus
CplusplusCplusplus
Cplusplus
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas MacFlashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
 
The CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGitThe CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGit
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
 
Wildlife conservation project management adri jovin
Wildlife conservation project management  adri jovinWildlife conservation project management  adri jovin
Wildlife conservation project management adri jovin
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
Hypercritical C++ Code Review
Hypercritical C++ Code ReviewHypercritical C++ Code Review
Hypercritical C++ Code Review
 

Recently uploaded

sample sample sample sample sample sample
sample sample sample sample sample samplesample sample sample sample sample sample
sample sample sample sample sample sample
Casey Keith
 
IATA GEOGRAPHY AREAS in the world, HM111
IATA GEOGRAPHY AREAS in the world, HM111IATA GEOGRAPHY AREAS in the world, HM111
IATA GEOGRAPHY AREAS in the world, HM111
2022472524
 
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
Abortion pills in Riyadh +966572737505 get cytotec
 
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent GirlsMorbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
mountabuangels4u
 
sample sample sample sample sample sample
sample sample sample sample sample samplesample sample sample sample sample sample
sample sample sample sample sample sample
Casey Keith
 

Recently uploaded (20)

Roorkee Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Roorkee Call Girls 🥰 8617370543 Service Offer VIP Hot ModelRoorkee Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Roorkee Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Udhampur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Udhampur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelUdhampur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Udhampur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Your Busy Season Email Marketing, Holly May Webinar.pptx
Elevate Your Busy Season Email Marketing, Holly May Webinar.pptxElevate Your Busy Season Email Marketing, Holly May Webinar.pptx
Elevate Your Busy Season Email Marketing, Holly May Webinar.pptx
 
Pauri Garhwal Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Pauri Garhwal Call Girls 🥰 8617370543 Service Offer VIP Hot ModelPauri Garhwal Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Pauri Garhwal Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Mehsana Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mehsana Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMehsana Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mehsana Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
sample sample sample sample sample sample
sample sample sample sample sample samplesample sample sample sample sample sample
sample sample sample sample sample sample
 
Lahaul Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Lahaul Call Girls 🥰 8617370543 Service Offer VIP Hot ModelLahaul Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Lahaul Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Paschim Medinipur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Paschim Medinipur Call Girls 🥰 8617370543 Service Offer VIP Hot ModelPaschim Medinipur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Paschim Medinipur Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
IATA GEOGRAPHY AREAS in the world, HM111
IATA GEOGRAPHY AREAS in the world, HM111IATA GEOGRAPHY AREAS in the world, HM111
IATA GEOGRAPHY AREAS in the world, HM111
 
Howrah Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Howrah Call Girls 🥰 8617370543 Service Offer VIP Hot ModelHowrah Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Howrah Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Lansdowne Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Lansdowne Call Girls 🥰 8617370543 Service Offer VIP Hot ModelLansdowne Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Lansdowne Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Sun World Bana Hills, Vienam Part 2 (越南 巴拿山太陽世界 下集).ppsx
Sun World Bana Hills, Vienam Part 2  (越南 巴拿山太陽世界 下集).ppsxSun World Bana Hills, Vienam Part 2  (越南 巴拿山太陽世界 下集).ppsx
Sun World Bana Hills, Vienam Part 2 (越南 巴拿山太陽世界 下集).ppsx
 
TOURISM ATTRACTION IN LESOTHO 2024.Pptx.
TOURISM ATTRACTION IN LESOTHO 2024.Pptx.TOURISM ATTRACTION IN LESOTHO 2024.Pptx.
TOURISM ATTRACTION IN LESOTHO 2024.Pptx.
 
Chamba Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Chamba Call Girls 🥰 8617370543 Service Offer VIP Hot ModelChamba Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Chamba Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
CYTOTEC DUBAI ☎️ +966572737505 } Abortion pills in Abu dhabi,get misoprostal ...
 
Nainital Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Nainital Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNainital Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Nainital Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Dimapur‎ Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Dimapur‎ Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDimapur‎ Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Dimapur‎ Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent GirlsMorbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
Morbi Escort💋 Call Girl (Komal) Service #Morbi Call Girl @Independent Girls
 
Prayagraj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Prayagraj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelPrayagraj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Prayagraj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
sample sample sample sample sample sample
sample sample sample sample sample samplesample sample sample sample sample sample
sample sample sample sample sample sample
 

Mauro yaguachi

  • 1. //#include <stdafx.h><br />#include <conio.h> <br />#include <windows.h><br />#include <string.h><br />#include <iostream.h> <br />//using namespace std;<br />#define cnt_max_string 10<br />#define cnt_char_ver 'x'<br />#define cnt_char_hor '-'<br />#define cnt_char_marco '*'<br />#define cnt_char_limpiar ' '<br />#define cnt_col_pant 5<br />#define cnt_fil_pant 2<br />#define cnt_col_mat 20<br />#define cnt_fil_mat 20<br />#define cnt_vec 20<br />#define cnt_num_campos 5<br />int VOPCION;<br />int VLV;<br />int Vfilas,Vcolumnas,edad;<br />int Vcodigo;<br />int Vbusqueda;<br />int Vfila_B;<br />struct Tpersona{<br />int codigo;<br />char nombres[cnt_max_string];<br />char direccion[cnt_max_string];<br />char telefono[cnt_max_string];<br />int edad;<br />}Vec_per[cnt_vec];<br />struct Tpersona Mat_per [cnt_fil_mat] [cnt_col_mat];<br />/*void gotoxy(int x, int y)<br />{<br /> COORD coord;<br /> coord.X = x;<br /> coord.Y = y;<br /> SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);<br />} */<br />void Linea (char Ptipo,char Pcaracter,int Pfil, int Pcol,int Pfili,int Pcoli)<br />{<br /> int vsm,vsmi,vsmf; <br /> int vsl,vsli,vslf; <br /> int vsinc;<br /> switch(Ptipo)<br /> {<br /> case 'V':<br /> vsli=(cnt_col_pant-1); vslf=((cnt_max_string*Pcol)+vsli+Pcol);<br /> vsmi=(cnt_fil_pant-1); vsmf=(((cnt_num_campos+1)*Pfil))+1;<br /> vsinc=cnt_max_string+1;<br /> break;<br /> case 'H':<br /> vsli=(cnt_fil_pant-1); vslf=(((cnt_num_campos+1)*Pfil))+1;<br /> vsmi=(cnt_col_pant-1); vsmf=((cnt_max_string*Pcol)+vsmi+Pcol);<br /> vsinc=cnt_num_campos+1;<br /> break;<br /> case 'X':<br /> vsli=Pcoli; vslf=Pcol; vsmi=Pfili; vsmf=Pfil; vsinc=Pcol-Pcoli;<br /> break;<br /> case 'Y':<br /> vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=Pfil-Pfili;<br /> break;<br /> case 'L':<br /> vsli=Pfili; vslf=Pfil; vsmi=Pcoli; vsmf=Pcol; vsinc=1;<br /> break;<br /> }<br /> <br /> for (vsl=vsli;vsl<=vslf;vsl+=vsinc)<br /> {<br /> for (vsm=vsmi;vsm<=vsmf;vsm++)<br /> {<br /> switch(Ptipo)<br /> {<br /> case 'V': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br /> case 'H': gotoxy(vsm,vsl); cout<< Pcaracter; break;<br /> case 'X': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br /> case 'Y': gotoxy(vsm,vsl); cout<< Pcaracter; break;<br /> case 'L': gotoxy(vsl,vsm); cout<< Pcaracter; break;<br /> }<br /> }<br /> }<br />};<br />void Matriz (int Pfil, int Pcol, char Popcion)<br /> { <br /> int vsy=0;<br /> for (int vsf = 0 ; vsf < Pfil ; vsf++)<br /> {<br /> int vsx=0;<br />for (int vsc = 0 ; vsc < Pcol ; vsc++)<br /> {<br /> switch(Popcion)<br /> {<br /> case 'I':<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+0));<br /> cin>> Mat_per[vsf] [vsc].codigo;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+1));<br /> cin>> Mat_per[vsf] [vsc].nombres;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+2));<br /> cin>> Mat_per[vsf] [vsc].direccion;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+3));<br /> cin>> Mat_per[vsf] [vsc].telefono;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+4));<br /> cin>> Mat_per[vsf] [vsc].edad;<br /> break;<br /> case 'P':<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+0));<br /> cout<< Mat_per[vsf] [vsc].codigo;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+1));<br /> cout<< Mat_per[vsf] [vsc].nombres;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+2));<br /> cout<< Mat_per[vsf] [vsc].direccion;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+3)); <br /> cout<< Mat_per[vsf] [vsc].telefono;<br /> gotoxy(cnt_col_pant+vsx,(cnt_fil_pant+vsy+4));<br /> cout<< Mat_per[vsf] [vsc].edad;<br /> break;<br /> } // fin del switch<br /> vsx+=cnt_max_string+1;<br /> } // fin del for vsc <br /> vsy+=cnt_num_campos+1;<br />} // fin del for vsf<br /> }// fin del void matriz<br />void Vector (int Plv, char Popcion)<br /> { <br /> int vsy=0;<br /> for (int vsf = 0 ; vsf < Plv ; vsf++)<br /> {<br /> switch(Popcion)<br /> {<br /> case 'I':<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cin>> Vec_per[vsf].codigo;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cin>> Vec_per[vsf].nombres;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+2));cin>> Vec_per[vsf].direccion;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+3));cin>> Vec_per[vsf].telefono;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+4));cin>> Vec_per[vsf].edad;<br /> break;<br /> case 'P':<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+0));cout<< Vec_per[vsf].codigo;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+1));cout<< Vec_per[vsf].nombres;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+2));cout<< Vec_per[vsf].direccion;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+3));cout<< Vec_per[vsf].telefono;<br /> gotoxy(cnt_col_pant,(cnt_fil_pant+vsy+4));cout<< Vec_per[vsf].edad;<br /> break;<br /> case 'B':<br /> if (Vec_per[vsf].codigo == Vcodigo)<br /> {<br />Vbusqueda=1; <br /> Vfila_B=vsf;<br /> }<br /> break;<br /> } // fin del switch<br /> vsy+=cnt_num_campos+1;<br />} // fin del for vsf<br /> }// fin del void vector<br />void menu()<br />{ <br />// system(quot; clsquot; );<br />clrscr();<br />int vsbandera;<br />char vseliminar;<br />vsbandera=1;<br /> while (vsbandera!=0)<br /> { <br /> // system(quot; clsquot; );<br /> clrscr();<br /> //Linea ('L',cnt_char_limpiar,24,79,0,0);<br /> Linea ('X',cnt_char_marco,23,79,0,0);<br /> Linea ('Y',cnt_char_marco, 23, 79,0,0);<br /> gotoxy(5,5);<br /> cout<< quot; Programa ejemplo del uso de estructuras con vectores y matrices quot; ; <br /> gotoxy(5,6);<br /> cout<< quot; **************************************************************quot; ; <br /> gotoxy(5,7); cout<< quot; 1: Ingreso de MATRIZ DE (N x N) quot; ; <br /> gotoxy(5,8); cout<< quot; 2: Reporte de MATRIZ DE (N x N) quot; ; <br /> gotoxy(5,9); cout<< quot; 3: Ingreso de VECTOR DE (N) quot; ; <br /> gotoxy(5,10);cout<< quot; 4: Reporte de VECTOR DE (N) quot; ; <br /> gotoxy(5,11);cout<< quot; 5: Eliminación de Registr quot; ; <br /> gotoxy(5,12);cout<<quot; DIGITE 0 PARA SALIR quot; ;<br /> gotoxy(5,13);<br /> cout<< quot; **************************************************************quot; ; <br /> gotoxy(5,14);cout<<quot; Opcion: < >quot; ;<br /> gotoxy(14,14);cin>> VOPCION;<br /> switch (VOPCION)<br /> { <br /> case 1:<br /> // system(quot; clsquot; );<br /> clrscr();<br /> Linea ('X',cnt_char_marco,25,79,0,0);<br /> Linea ('Y',cnt_char_marco, 25, 79,0,0);<br /> Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br /> Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br /> gotoxy(cnt_col_pant,cnt_fil_pant);<br /> cout<< quot; Ingreso datos de una matriz quot; ;<br /> gotoxy(cnt_col_pant,cnt_fil_pant+1);<br /> cout<< quot; Inserte filas de la matriz : quot; ;<br /> cin>> Vfilas;<br /> gotoxy(cnt_col_pant,cnt_fil_pant+2);<br /> cout<< quot; Inserte columnas de la matriz: quot; ;<br /> cin>> Vcolumnas;<br />// system(quot; clsquot; );<br />clrscr();<br /> Linea ('V',cnt_char_ver, Vfilas, Vcolumnas,0,0);<br /> Linea ('H',cnt_char_hor, Vfilas, Vcolumnas,0,0);<br /> Matriz(Vfilas, Vcolumnas,'I');<br /> break; <br /> case 2:<br />// system(quot; clsquot; );<br /> clrscr();<br /> Linea ('V',cnt_char_ver, Vfilas, Vcolumnas,0,0);<br /> Linea ('H',cnt_char_hor, Vfilas, Vcolumnas,0,0);<br /> Matriz(Vfilas, Vcolumnas,'P');<br />while (getche() != '');<br />getche();<br /> break;<br /> case 3:<br /> // system(quot; clsquot; );<br /> clrscr();<br /> Linea ('X',cnt_char_marco,25,79,0,0);<br /> Linea ('Y',cnt_char_marco, 25, 79,0,0);<br /> Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br /> Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br /> gotoxy(cnt_col_pant,cnt_fil_pant); <br /> cout<< quot; Ingreso de datos en un Vector quot; ;<br /> gotoxy(cnt_col_pant,cnt_fil_pant+1); <br /> cout<< quot; Ingrese Longitud del Vector: quot; ;<br /> cin>>VLV;<br /> //system(quot; clsquot; );<br /> clrscr();<br /> Linea ('V',cnt_char_ver, VLV,1,0,0);<br /> Linea ('H',cnt_char_hor, VLV,1,0,0);<br /> Vector (VLV,'I');<br /> break;<br /> case 4:<br />// system(quot; clsquot; );<br />clrscr();<br /> Linea ('V',cnt_char_ver, VLV,1,0,0);<br /> Linea ('H',cnt_char_hor, VLV,1,0,0);<br /> Vector (VLV,'P');<br />while (getche() != '');<br />getche();<br /> break;<br /> case 5:<br /> // system(quot; clsquot; );<br /> clrscr();<br /> Vbusqueda=0;<br /> Linea ('X',cnt_char_marco,25,79,0,0);<br /> Linea ('Y',cnt_char_marco, 25, 79,0,0);<br /> Linea ('X',cnt_char_marco,cnt_fil_pant+3,40,cnt_fil_pant-1,cnt_col_pant-1);<br /> Linea ('Y',cnt_char_marco, cnt_fil_pant+3, 40,cnt_fil_pant-1,cnt_col_pant-1);<br /> gotoxy(cnt_col_pant,cnt_fil_pant); cout<< quot; Busqueda en un Vector quot; ;<br /> gotoxy(cnt_col_pant,cnt_fil_pant+1); cout<< quot; Ingrese codigo: quot; ;<br /> cin>>Vcodigo;<br />// system(quot; clsquot; );<br />clrscr();<br /> Linea ('V',cnt_char_ver, VLV,1,0,0);<br /> Linea ('H',cnt_char_hor, VLV,1,0,0);<br /> Vector (VLV,'P');<br /> Vector (VLV,'B');<br /> if (Vbusqueda==1)<br /> {<br /> Linea ('X',cnt_char_marco,cnt_fil_pant+14,60,cnt_fil_pant-1,cnt_col_pant-1);<br /> Linea ('Y',cnt_char_marco, cnt_fil_pant+14,60,cnt_fil_pant-1,cnt_col_pant-1);<br /> gotoxy(cnt_col_pant+15,cnt_fil_pant+3);<br /> cout<< quot; Desea eliminar el registro S/N : quot; ;<br /> cin>>vseliminar; <br /> switch (vseliminar)<br /> { <br /> case 's':case 'S':<br /> Vec_per[Vfila_B].codigo=0;<br /> strcpy(Vec_per[Vfila_B].nombres,quot; quot; );<br /> strcpy(Vec_per[Vfila_B].direccion,quot; quot; );<br /> strcpy(Vec_per[Vfila_B].telefono,quot; quot; );<br /> Vec_per[Vfila_B].edad=0;<br />// system(quot; clsquot; );<br /> Linea ('V',cnt_char_ver, VLV,1,0,0);<br /> Linea ('H',cnt_char_hor, VLV,1,0,0);<br /> Vector (VLV,'P');<br /> break;<br />} <br /> }<br />while (getche() != '');<br />getche();<br /> break;<br /> case 0:<br />cout<<quot; quot; ;<br />cout<< quot; Pulse cualquier tecla para continuarquot; ;<br />getche();<br />vsbandera=0;<br /> }<br /> }<br /> }<br />void main(void)<br /> { menu(); }<br />