• Save
VECTOR ASCENDENTE
Upcoming SlideShare
Loading in...5
×
 

VECTOR ASCENDENTE

on

  • 558 views

 

Statistics

Views

Total Views
558
Views on SlideShare
558
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    VECTOR ASCENDENTE VECTOR ASCENDENTE Document Transcript

    • ____________________________________________________________________________________________________________________program VectorAscendente;uses crt;varvec:array[1..14]of integer;j,i,aux,n:integer;begintextbackground(4);textcolor(2);clrscr;gotoxy(3,2);writeln(PROGRAMA VECTORES: METODO BURBUJA.);gotoxy(3,4);writeln(Este programa permite almacenar 13 numeros y ordenarlos de formaascendente.);gotoxy(3,6);write(Cuantos datos desea almacenar: );read(n);while (n<1) or (n>13) dobegingotoxy(3,8);write(Rango del numero no permitido);gotoxy(3,9);write(Ingrese de nuevo el numero de datos a almacenar: );clreol;read(n);end;clrscr;j:=-2;for i:=1 to n dobeginj:=j+6;
    • gotoxy(j,2);read(vec[i]);end;for i:=1 to n-1 dobeginfor j:=i+1 to n dobeginif vec[i]>vec[j] thenbeginaux:=vec[i];vec[i]:=vec[j];vec[j]:=aux;end;end;end;j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,4);textcolor(yellow);write(vec[i]);end;readkey;end.____________________________________________________________________________________________________________________
    • ____________________________________________________________________________________________________________________program VectorMetodoBurbuja;uses crt;varvec:array[1..13]of integer;j,i,aux,n:integer;begintextbackground(4);textcolor(2);clrscr;gotoxy(3,2);writeln(PROGRAMA VECTORES: METODO BURBUJA.);gotoxy(3,4);writeln(Este programa permite almacenar 13 numeros y ordenarlos de formaascendente.);gotoxy(3,6);write(Cuantos datos desea almacenar: );read(n);textcolor(yellow);j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,8);read(vec[i]);end;for i:=1 to n-1 dobeginfor j:=i+1 to n dobeginif vec[i]>vec[j] thenbegin
    • aux:=vec[i];vec[i]:=vec[j];vec[j]:=aux;end;end;end;j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,10);write(vec[i]);end;readkey;end.____________________________________________________________________________________________________________________